Search Results

Search found 12421 results on 497 pages for 'date arithmetic'.

Page 28/497 | < Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >

  • Extend Javascript Date Object

    - by jAndy
    Hi Folks, I'm curious what would be the best practice to extend the Date constructor. The problem I'm facing is, that the Internet Explorer (< 7+8) can't parse a date like new Date('2010-05-11'); I have to admit that this is not a standard method to parse, anyways FireFox and Chrome perform well on that kind of date string. Now I'm wondering, should I just split/parse/rebuild the string before calling new Date() or is there a more elegant solution ?

    Read the article

  • Arithmetic Operations in Arrays with PHP

    - by Ajith
    I have two arrays $data1 = array() $data1 = array( '10','22','30') and also another array carries $data2 = array() $data2 = array( '2','11','3'); I need to divide these two arrays(ie,$data1/$data2) and store value to $data3[]. I need to get it as follows $data3[] = array('5','2','10') If someone knows of an easy way to do this would be of great help. Thanks

    Read the article

  • The unary increment operator in pointer arithmetic

    - by RhymesWithDuck
    Hello, this is my first post. I have this function for reversing a string in C that I found. void reverse(char* c) { if (*c != 0) { reverse(c + 1); } printf("%c",*c); } It works fine but if I replace: reverse(c + 1); with: reverse(++c); the first character of the original string is truncated. My question is why would are the statements not equivalent in this instance? Thanks

    Read the article

  • Freeing memory with Pointer Arithmetic

    - by Breedly
    C++ newb here. I'm trying to write my own implementation of an array using only pointers, and I've hit a wall I don't know how to get over. My constructor throws this error array.cpp:40:35: error: invalid conversion from ‘int*’ to ‘int’ [-fpermissive] When my array initializes I want it to free up all the spaces in the array for ints. Array::Array(int theSize){ size = theSize; int *arrayPointer = new int; int index = 0; while(theSize > index){ *(arrayPointer + index) = new int; //This is the trouble line. ++index; } } What am I doing wrong stackoverflow?

    Read the article

  • show date and time in php

    - by abhishek
    0 down vote hi, I have problem in showing $date="2011-02-10 15:26:20"; in the format of Thursday 10th of February 2011 03:26:20 PM in php. i know there is one date function in php and can be done in one line for example: but via this it will flash today date or so. i want to do it when user check any date and want that date in the format which i mention earlier. please revert me back as soon as posib.... thanks

    Read the article

  • Save the Date for Oracle’s 2015 JD Edwards Summit

    - by Catalin Teodor
    If you’re part of the JD Edwards community, you won’t want to miss our 6th annual JD Edwards Summit. Please save the date for this event in Broomfield, Colorado on Monday, February 2 through Thursday, February 5. Formal invitation and registration to come soon.We welcome the opportunity to hear from you regarding any specific topics you would like to see covered during this valuable exchange. Please send your ideas to Sheila Ebbitt at sheila.ebbitt-AT-oracle-DOT-com.Partners interested in sponsorship should contact Rene Chapman at rene.chapman-AT-oracle-DOT-com.

    Read the article

  • Utilize different region format for a single application on Mac OS X

    - by Jeff Hellman
    Is there a way to have a single Mac OS X application utilize a different region format than the system default? For example, I'd like to keep my system operating in English with US date formats but have my lesson planning software utilize French date formats. If I put my entire computer into French mode, I get the desired results, but I'd rather keep my entire system in US mode and have the Planbook application work with French region formats. I know about Language Switcher but that only allow per-app selections of localizations to be used, not which date format to use. I don't care about having the French localization of Planbook appear, I just want the date format to be French.

    Read the article

  • Finding day of week in batch file? (Windows Server 2008)

    - by Daniel Magliola
    I have a process I run from a batch file, and i only want to run it on a certain day of the week. Is it possible to get the day of week? All the example I found, somehow rely on "date /t" to return "Friday, 12/11/2009", however, in my machine, "date /t" returns "12/11/2009". No weekday there. I've already checked the "regional settings" for my machine, and the long date format does include the weekday. The short date format doesn't, but i'd really rather not change that, since it'll affect a bunch of stuff I do. Any ideas here? Thanks! Daniel

    Read the article

  • New Date for Implementation of Sun Hands-On Course Requirement

    - by Harold Green
    As announced on the Oracle Certification website, Java Architect, Java Developer, Solaris System Administrator and Solaris Security Administrator certification tracks will include a new mandatory course attendance requirement. Because of unforeseen disaster and subsequent recovery efforts underway in Japan, Oracle has extended the start date of this new requirement to October 1, 2011. Candidates may earn their certifications using the current track requirements (found on the Oracle Certification website) through September 30, 2011.

    Read the article

  • Website Registration Date

    - by Matt Walker
    I recently registered a website : cinematrailers.net. I was aware that this domain was expired ( registered in 2007 until 2011) My question is when I go to view the registration date on this domain, it says 2012 instead of 2007. Why is that when it was clearly registered in 2007? And will this affect seo? I was under the assumption that the domains age would be great for seo, but now I'm not sure.

    Read the article

  • Change color of Date and Weather app in Ubuntu 12.04 & Mate

    - by haunted85
    I have recentely installed Ubuntu 12.04 and as I am a truly Gnome 2 lover I also switched from Unity to Mate. The font color of the Weather/Date applet is barely visible so I was wondering how I can change it. I Already tried to explore all the options shown in the menu when I right-click on the applet, but apparently there's no such feature. So is there anything I could do in order to customize the font color in order to make the text more readable?

    Read the article

  • Finding day of week in batch file? (Windows Server 2008)

    - by Daniel Magliola
    I have a process I run from a batch file, and i only want to run it on a certain day of the week. Is it possible to get the day of week? All the example I found, somehow rely on "date /t" to return "Friday, 12/11/2009", however, in my machine, "date /t" returns "12/11/2009". No weekday there. I've already checked the "regional settings" for my machine, and the long date format does include the weekday. The short date format doesn't, but i'd really rather not change that, since it'll affect a bunch of stuff I do. Any ideas here? Thanks! Daniel

    Read the article

  • CMD file time not always matching windows explorer file time

    - by skyrail
    I have a set of file I need to set the created, modified and last access date to exif date taken value, after a copy between 2 folders (might be fat32 on memory card or ntfs on fixed or usb disk). When I copy a file, the date and time switch to the current date. Then I change all 3 dates manually, either with change attributes in windows explorer or far manager on the command line. To make it faster I wrote a batch script getting original file dates (with php and function stat), building a batch script that invoke nircmd setfiletime for each file. Then I apply this batch to the copied version. The operation is relatively fast and reliable. Unfortunately, a bunch of files have last access and created time different in cmd and windows explorer (1H difference). Very strangely, it happens with dates between november and february, which make the operation unreliable. Why is this happening, and how can I fix it?

    Read the article

  • GUI time is different than command line time

    - by Kyle
    I have kind of an odd problem. The time in my Unity bar is right, but the time in bash is 2 hours ahead. $ date Wed Jun 20 15:31:55 CDT 2012 Unity bar: Wed Jun 20 13:31:55 Here are my etc configs: $ cat /etc/timezone America/Los_Angeles locale: $ locale LANG=en_US.UTF-8 LANGUAGE= LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL= Finally, I tried $ sudo dpkg-reconfigure tzdata and setting it to "Los_Angeles". Has anyone seen anything like this?

    Read the article

  • sqlalchemy date type in 0.6 migration using mssql

    - by nosklo
    I'm connection to mssql server through pyodbc, via FreeTDS odbc driver, on linux ubuntu 10.04. Sqlalchemy 0.5 uses DATETIME for sqlalchemy.Date() fields. Now Sqlalchemy 0.6 uses DATE, but sql server 2000 doesn't have a DATE type. How can I make DATETIME be the default for sqlalchemy.Date() on sqlalchemy 0.6 mssql+pyodbc dialect? I'd like to keep it as clean as possible. Here's code to reproduce the issue: import sqlalchemy from sqlalchemy import Table, Column, MetaData, Date, Integer, create_engine engine = create_engine( 'mssql+pyodbc://sa:sa@myserver/mydb?driver=FreeTDS') m = MetaData(bind=engine) tb = sqlalchemy.Table('test_date', m, Column('id', Integer, primary_key=True), Column('dt', Date()) ) tb.create() And here is the traceback I'm getting: Traceback (most recent call last): File "/tmp/teste.py", line 15, in <module> tb.create() File "/home/nosklo/.local/lib/python2.6/site-packages/sqlalchemy/schema.py", line 428, in create bind.create(self, checkfirst=checkfirst) File "/home/nosklo/.local/lib/python2.6/site-packages/sqlalchemy/engine/base.py", line 1647, in create connection=connection, **kwargs) File "/home/nosklo/.local/lib/python2.6/site-packages/sqlalchemy/engine/base.py", line 1682, in _run_visitor **kwargs).traverse_single(element) File "/home/nosklo/.local/lib/python2.6/site-packages/sqlalchemy/sql/visitors.py", line 77, in traverse_single return meth(obj, **kw) File "/home/nosklo/.local/lib/python2.6/site-packages/sqlalchemy/engine/ddl.py", line 58, in visit_table self.connection.execute(schema.CreateTable(table)) File "/home/nosklo/.local/lib/python2.6/site-packages/sqlalchemy/engine/base.py", line 1157, in execute params) File "/home/nosklo/.local/lib/python2.6/site-packages/sqlalchemy/engine/base.py", line 1210, in _execute_ddl return self.__execute_context(context) File "/home/nosklo/.local/lib/python2.6/site-packages/sqlalchemy/engine/base.py", line 1268, in __execute_context context.parameters[0], context=context) File "/home/nosklo/.local/lib/python2.6/site-packages/sqlalchemy/engine/base.py", line 1367, in _cursor_execute context) File "/home/nosklo/.local/lib/python2.6/site-packages/sqlalchemy/engine/base.py", line 1360, in _cursor_execute context) File "/home/nosklo/.local/lib/python2.6/site-packages/sqlalchemy/engine/default.py", line 277, in do_execute cursor.execute(statement, parameters) sqlalchemy.exc.ProgrammingError: (ProgrammingError) ('42000', '[42000] [FreeTDS][SQL Server]Column or parameter #2: Cannot find data type DATE. (2715) (SQLExecDirectW)') '\nCREATE TABLE test_date (\n\tid INTEGER NOT NULL IDENTITY(1,1), \n\tdt DATE NULL, \n\tPRIMARY KEY (id)\n)\n\n' ()

    Read the article

  • Filter a date property between a begin and end Dates with JDOQL

    - by Sergio del Amo
    I want to code a function to get a list of Entry objects whose date field is between a beginPeriod and endPeriod I post below a code snippet which works with a HACK. I have to substract a day from the begin period date. It seems the condition great or equal does not work. Any idea why I have this issue? public static List<Entry> getEntries(Date beginPeriod, Date endPeriod) { /* TODO * The great or equal condition does not seem to work in the filter below * Substract a day and it seems to work */ Calendar calendar = Calendar.getInstance(); calendar.set(beginPeriod.getYear(), beginPeriod.getMonth(), beginPeriod.getDate() - 1); beginPeriod = calendar.getTime(); PersistenceManager pm = JdoUtil.getPm(); Query q = pm.newQuery(Entry.class); q.setFilter("this.date >= beginPeriodParam && this.date <= endPeriodParam"); q.declareParameters("java.util.Date beginPeriodParam, java.util.Date endPeriodParam"); List<Entry> entries = (List<Entry>) q.execute(beginPeriod,endPeriod); return entries; }

    Read the article

  • Comparing two date ranges within the same table

    - by Danny Herran
    I have a table with sales per store as follows: SQL> select * from sales; ID ID_STORE DATE TOTAL ---------- -------- ---------- -------------------------------------------------- 1 1 2010-01-01 500.00 2 1 2010-01-02 185.00 3 1 2010-01-03 135.00 4 1 2009-01-01 165.00 5 1 2009-01-02 175.00 6 5 2010-01-01 130.00 7 5 2010-01-02 135.00 8 5 2010-01-03 130.00 9 6 2010-01-01 100.00 10 6 2010-01-02 12.00 11 6 2010-01-03 85.00 12 6 2009-01-01 135.00 13 6 2009-01-02 400.00 14 6 2009-01-07 21.00 15 6 2009-01-08 45.00 16 8 2009-01-09 123.00 17 8 2009-01-10 581.00 17 rows selected. What I need to do is to compare two date ranges within that table. Lets say I need to know the differences in sales between 01 Jan 2009 to 10 Jan 2009 AGAINST 01 Jan 2010 to 10 Jan 2010. I'd like to build a query that returns something like this: ID_STORE_A DATE_A TOTAL_A ID_STORE_B DATE_B TOTAL_B ---------- ---------- --------- ---------- ---------- ------------------- 1 2010-01-01 500.00 1 2009-01-01 165.00 1 2010-01-02 185.00 1 2009-01-02 175.00 1 2010-01-03 135.00 1 NULL NULL 5 2010-01-01 130.00 5 NULL NULL 5 2010-01-02 135.00 5 NULL NULL 5 2010-01-03 130.00 5 NULL NULL 6 2010-01-01 100.00 6 2009-01-01 135.00 6 2010-01-02 12.00 6 2009-01-02 400.00 6 2010-01-03 85.00 6 NULL NULL 6 NULL NULL 6 2009-01-07 21.00 6 NULL NULL 6 2009-01-08 45.00 6 NULL NULL 8 2009-01-09 123.00 6 NULL NULL 8 2009-01-10 581.00 So, even if there are no sales in one range or another, it should just fill the empty space with NULL. So far, I've come up with this quick query, but I the "dates" from sales to sales2 sometimes are different in each row: SELECT sales.*, sales2.* FROM sales LEFT JOIN sales AS sales2 ON (sales.id_store=sales2.id_store) WHERE sales.date >= '2010-01-01' AND sales.date <= '2010-01-10' AND sales2.date >= '2009-01-01' AND sales2.date <= '2009-01-10' ORDER BY sales.id_store ASC, sales.date ASC, sales2.date ASC What am I missing?

    Read the article

  • Binding a date string parameter in an MS Access PDO query

    - by harryg
    I've made a PDO database class which I use to run queries on an MS Access database. When querying using a date condition, as is common in SQL, dates are passed as a string. Access usually expects the date to be surrounded in hashes however. E.g. SELECT transactions.amount FROM transactions WHERE transactions.date = #2013-05-25#; If I where to run this query using PDO I might do the following. //instatiate pdo connection etc... resulting in a $db object $stmt = $db->prepare('SELECT transactions.amount FROM transactions WHERE transactions.date = #:mydate#;'); //prepare the query $stmt->bindValue('mydate', '2013-05-25', PDO::PARAM_STR); //bind the date as a string $stmt->execute(); //run it $result = $stmt->fetch(); //get the results As far as my understanding goes the statement that results from the above would look like this as binding a string results in it being surrounded by quotes: SELECT transactions.amount FROM transactions WHERE transactions.date = #'2013-05-25'#; This causes an error and prevents the statement from running. What's the best way to bind a date string in PDO without causing this error? I'm currently resorting to sprintf-ing the string which I'm sure is bad practise. Edit: if I pass the hash-surrounded date then I still get the error as below: Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[22018]: Invalid character value for cast specification: -3030 [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression. (SQLExecute[-3030] at ext\pdo_odbc\odbc_stmt.c:254)' in C:\xampp\htdocs\ips\php\classes.php:49 Stack trace: #0 C:\xampp\htdocs\ips\php\classes.php(49): PDOStatement-execute() #1 C:\xampp\htdocs\ips\php\classes.php(52): database-execute() #2 C:\xampp\htdocs\ips\try2.php(12): database-resultset() #3 {main} thrown in C:\xampp\htdocs\ips\php\classes.php on line 49

    Read the article

  • Web application date time localization best practice at 201x

    - by Hieu Lam
    Hi all, I have worked for various web projects but correct date time localization have not been done and considered throroughly so I want to ask this very typical problem here and I want to hear comments from expert in this problem What is the correct strategy for storing a date/time value from client from server As I understand, because of locale and timezone so we have to do the conversion, I have heard about GMT or UTC time and after do some search it seems that UTC is more accurate ? so we will convert from client time - UTC+0 when saving and when we read the value from server to client, we convert from server time back to client time again ? However, I see in some website, at the bottom have the sentence "All times are in UTC", "All times are in GMT" and also "All times are in your local time". So maybe not all the sites do the convertion back and forth ? And in that case the user has to manually do the date/time conversion ? How to display the date/time convenient to user based on his locale and region How to provide personalization on date/time value ? I had one time depends on vbscript to do the display and the format is read from windows regional and format settings automatically. But without vbscript how can we determine a date/time pattern for a user of a specific locale. Do we have to store a mapping between a locale and pattern somewhere and do the conversion at the server side ? Although date/time conversion is needed in most case, there's situation where only date matter for example if my birthday is 2 Feb 1980, it should be the same for all locale and no conversion should be done. How can we address this issue.

    Read the article

< Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >