date

How to get the number of days of difference between two dates on mysql?

I need to get the number of days contained within a couple of dates on mysql. For example: Check in date 12-04-2010 Check out date 15-04-2010 and the day difference would be 3 I hope that was clear Thanks ...

Is XML a good logic to load data??

Hi stack, i'm working on an app that loads some data from xml file from internet. Is this a good way to develop iPhone apps??...I think xml is more light than SQlite database... Basically my logic is: 1 - Parsing Xml file from internet to retrive the data 2 - Load data on device Security?..other stuff??.. Thanks Mat ...

Why is PHP date() adding +1 hour in diff calculation?

Hi there, I've got kind of a tricky question, I already searched every related question on Stackoverflow and neither solved my conundrum, although I think I'm running in circles, so here's the question: I've got this code: $val = (strtotime('2010-03-22 10:05:00')-strtotime('2010-03-22 09:00:00')) This returns correctly $val = 3900 ...

How does the iPhone SDK Core Data system store date types to sqlite?

I used core data to do this: NSManagedObjectContext *m = [self managedObjectContext]; Foo *f = (Foo *)[NSEntityDescription insertNewObjectForEntityForName:@"Foo" inManagedObjectContext:m]; f.created_at = [NSDate date]; [m insertObject:f]; NSError *error; [m save:&error]; Where ...

Formatting the date in unix to include suffix on day (st, nd, rd and th)

How can I add the suffix on the day number of a unix date? I'll explain. I have a TextMate bundle snippit that writes out today's date. It uses unix date and formatting. Here is the code: `date +%A` `date +%d` `date +%B` `date +%Y` It outputs: Monday 22 March 2010 I would like to add the suffix to the day (st, nd, rd and th) like s...

Javascript array of dates - not iterating properly (jquery ui datepicker)

Hi I have some code which builds an array of date ranges. I then call a function (from the jquery UI datepicker), passing it a date, and compare that date with dates in the array. I'm doing it this way because the dates are stored in a cms and this is the only way I can output them. Unfortunately my code only checks the first date ran...

NSDate expressed in different time zones, i.e. local time zone (GMT-400) to PST

I know how to use NSTimeZone to derive the offset for the current time in another time zone. NSDate always returns relative to GMT, so how do I derive a string with the proper time zone information? i.e. I take the current time where I am (in EST) and using NSTimeZone end up subtracting the 3 hours necessary to represent the time in PST....

javascript/json date literal

What's the date literal for JSON/JavaScript ( if such thing does exists? ) ...

Converting from a day of week to unix time in PHP

Hi, I'm trying to get the unix time for date strings that are formatted like so: 'second sunday of march 2010' 'first sunday of november 2010' I was under the impression that strtotime could handle such a string, but apparently not, as this returns false. How can I convert to unix time when given a day of week, which one of those in t...

mysql: check if interval between two dates is less than 1 second

Ok, I need something like this: datediff(second, date_one, date_two) < 1 dates are stored in a column 'datetime' type UPDATE I want to find dates which differ in less than several (say, 10) seconds ...

How to add days to a date in Java

I want to add days to a date to get a new date in Java. How to achieve it using the Calender class. Calender dom = new GregorianCalender(d, m y); is the instance of my date of manufacture and I want to reach to date of expiry adding some 100 days to the current date and store it in doe but unable to do that. Any help would be appreci...

index for `where wakeup_time < sysdate`

Hi For most records this field is null. I need to wake up only some records. The table is very big and I want to know which records to wake up. I don't want database to seek every row. Could you show me your idea? ...

How can I calculate what date Good Friday falls on given a year?

Does anyone have a good algorithm to calculate what date Good Friday falls on given the year as an input? Preferably in C#. ...

Get the last day of the last month in csh?

How do you get the last day of the last month in csh? Here is the code so far. The cal command below almost works if you execute it from the (FreeBSD sh) command line, but I'm having trouble escaping it properly to run within a script. By almost work, I mean it returns 31, when the last day of February 2010 is 28. #!/bin/csh set last...

I need to convert the date from mm/dd/yyyy to dd/mm/yyyy in vbscript.

HI Everyone, So far I have this: FormatDateTime(negativeItemsRS("ItemDate"), 0) Its displaying the date in the format of mm/dd/yyyy. I want to convert that to a dd/mm/yyyy Please help not sure how to do this. Thanks, ...

Find next date for certain record in SQL Server 2008

Hi In SQL Server 2008: I have two tables, dtlScheme and dtlRenewal, with a one to many relationship (one scheme can have many renewals). dtlRenewal has a unique key (dteEffectiveDate, dtlSchemeID). Now suppose I have the following data in dtlRenewal: dtlRenewalID dtlSchemeID dteEffectiveDate 1 1 1/1/2005 2 ...

php date list for specified duration

hi is there any php classes or functions, which will gives us all the days from specific duration? for example, if i want a list of dates from 25/03/2010 (25th march 2010) to 15/05/2010 (15th May 2010), it will give me: 25/03/2010 26/03/2010 26/03/2010 .... .... .... 14/05/2010 15/05/2010 thanks a lot for any help! ...

In VB, calculating the 5th working day of every month

In VB, what coding could I use to calculate the 5th working day of every month? And if the 5th day is a holiday to go up one day. ...

How can I find a max/min date using multiple tables in sql 2005

I'm rather new to coding so I'm sure this is fairly easy, but I have not been able to figure this out. I'm building a report in reporting serivces, sql 2005. I have 4 tables: people, event log, program enrollment and program info. I have clients that could be enrolled in numerous programs. I need to be able to find a client's first enrol...

What is the MM/DD/YYYY regular expression and how do I use it in php?

I found the regular expression for MM/DD/YYYY at http://www.regular-expressions.info/regexbuddy/datemmddyyyy.html but I don't think I am using it correctly. Here's my code: $date_regex = '(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d'; $test_date = '03/22/2010'; if(preg_match($date_regex, $test_date)) { echo 'this d...