date

count date difference in hours using php and mysql

Hi, How can i find the date difference in hours using php and mysql both. Thanks Avinash ...

Is there a library in Python that can convert user-dates to timestamp?

If the month is: "12" Day is: "05" Year is: "2010" Can this be converted into a timestamp somehow, in a very simple way? ...

how to get previous date in java

I have a String in format yyyyMMdd. Is there a simple way to get a String with previous date in the same format? Thanks ...

Parsing RFC 2822 date in JAVA

I need to parse an RFC 2822 string representation of a date in Java. An example string is here: Sat, 13 Mar 2010 11:29:05 -0800 It looks pretty nasty so I wanted to make sure I was doing everything right and would run into weird problems later with the date being interpreted wrong either through AM-PM/Military time problems, UTC t...

core data date format question

i have my table sorted by date - long format with time and everything. i want to format timeStamp to dd,mm,yyyy and send use it as titleforheaderinsection method...how and where do i do this? ...

In Python, if I have a unix timestamp, how do I insert that into a MySQL datetime field?

I am using Python MySQLDB, and I want to insert this into DATETIME field in Mysql . How do I do that with cursor.execute? ...

Javascript data parsing in IE vs other browsers... It seems kinda screwed up. What's the deal?

Firstly, when I say other browsers I really only mean Firefox because that's all I tested in. Internet Explorer can parse a date followed by a single character as a proper date. Whereas Firefox behaves as I'd expect. For example... var dateString = new Date("1/1/2010f"); alert(dateString); In IE it will alert... Thu Dec 31 21:00...

compare function for dates

I have struct as: struct stored { char *dates; // 12/May/2010, 10/Jun/2010 etc.. }; // const struct stored structs[] = {{"12/May/2010"}, {"12/May/2011"}, {"21/May/2009"}, {"13/May/2011"}, {"10/May/2011"}, {"19/May/2011"}}; What I want to do is to sort struct 'stored' by store...

Using jQuery to find and then reformat a date string

Hello, I currently am displaying dates as follows "yyyy/mm/dd" in a wordpress blog (it needs to be input in this format because a plugin is using it to define a post expiration date). I want to use jQuery to locate all of these strings on a page (they're all in table cells) and reformat them to "mm.dd.yy" The site is: http://www.beat...

Setting a date format in ASP.NET web.config globalization tag?

In our web.config I am using the following tag to determine the interface language of an ASP.NET website. <globalization enableClientBasedCulture="true" culture="auto:en-GB" uiCulture="auto:en"/> This works as expected: Client wo request a specific localisation get it, everybody else is happily looking at the en-GB s...

See if the current time falls within a specific range of time in the current day in Java

I am sure this was done 1000 times in 1000 different places. The question is I want to know if there is a better/standard/faster way to check if current "time" is between two time values given in hh:mm:ss format. For example, my big business logic should not run between 18:00:00 and 18:30:00. So here is what I had in mind: public stati...

PHP date() returns odd values

echo date("W",strtotime('2010-01-01')); This outputs 53. I would expect it to output 1. Can anyone else confirm this behavior, or maybe explain why? I couldn't find a bug report on it. ...

Remove leading zeros from abbreviated date with PHP

Hello, I was wondering if there is a way, using PHP, to change this date format: 01.08.86 (January 8, 1986) to this format: 1.8.86. ...

Change date format (in DB or output) to dd/mm/yyyy - PHP MySQL

MySQL stores the date in my database (by default) as 'YYYY-MM-DD' The field type for my date is 'DATE' (I do not need any time storage).. Is there a simple way to change it by default to DD/MM/YYYY ? I call up different dates in 2 different tables, and no where in any of my code do I have anything resembling a date variable or anything!...

PHP Round Minute to nearest Quarter Hour

I need to round times down to the nearest quarter hour in PHP. The times are being pulled from a MySQL database from a datetime column and formatted like 2010-03-18 10:50:00. Example: 10:50 needs to be 10:45 1:12 needs to be 1:00 3:28 needs to be 3:15 etc. I'm assuming floor() is involved but not sure how to go about it. Thanks ...

Re-Convert timestamp DATE back to original format (when editing) PHP MySQL

Ok so I have managed to get the format of the date presented in HTML (upon display) to how I want (dd/mm/yyy)...However, the user also can change the date via a form. So this is how it's setup as present. Firstly, the conversion from YYYY-MM-DD to DD/MM/YYYY and then display in HTML: $timestamp = strtotime($duedate); echo da...

ignoring saturday and sunday

I am pulling in all the records from my customer database(mysql) for the last ten days $offset1 =strtotime("-10 day"); $date3=date("Y-m-d",$offset1); SELECT * FROM customers WHERE date between '$date3' and '$date' AND customer.custid = '$custid' ORDER by date DESC I would like to leave out the dates falling on a saturday o...

Mac OS date command - getting higher temporal resolution

Hey all, I am trying to use the date command in Terminal on multiple Mac OS X machines that are synced via NTP to synchronize some code in a program. Essentially I am running a program... MyProgram with arguments[date] I can get date to give me the seconds since the Unix epoch with the %M specifier. When I try to use %N to get nanosec...

Any significance to Google's "expires" date being Fri, 01 Jan 1990 00:00:00 GMT?

I was looking at the response headers for my GMail account and noticed that the date Fri, 01 Jan 1990 00:00:00 GMT shows up as the value for "Expires" over and over again. I suppose this is just an easy constant to make sure the browser understands this is past its freshness date. But is there any significance to that particular date? On...

PHP: convert date format yyyy-mm-dd => dd-mm-yyyy [NOT IN SQL]

hey guys, i am trying to convert a date from yyyy-mm-dd to dd-mm-yyyy however i dont know how the date function requires a timestamp and i cant get a timestamp form this string... anyone an idea? thanks Matthy ...