date

format as GMT/UTC time when default timezone is something else

Hey all. I have a program which needs to run under my local timezone for other reasons, but for one procedure i need to output dates using a SimpleDateFormat in GMT. what is the tidiest way to do this? ...

Strange problem with timezone, calendar and SimpleDateFormat

Let's consider the following code: SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss dd/MM/yyyy", Locale.US); long start = sdf.parse("10:30:00 30/09/2009").getTime(); long end = sdf.parse("10:30:00 30/10/2009").getTime(); Calendar c = Calendar.getInstance(Locale.US); c.setTimeInMillis(start); System.out.println("Start = " + c.getTi...

Mysql date query to find if the current is within two dates?

In my table I have two fields: start_date and end_date. I'm just trying to retrieve rows where the current date is between the start and end dates. For some reason, I am not getting this at all. I've tried using between, but I keep getting empty sets even though I know that there are records that exist... I don't think I'm thinking a...

How do you change the timezone in PHP for an existing timestamp?

The code for the date and time function: function date_and_time($format,$timestamp) { $date_and_time = date($format,$timestamp); return $date_and_time; } And then the code to display it: <?php echo date_and_time("dS F Y", strtotime($profile[last_activity_date_and_time])); ?> The value of $profile[last_activity_d...

most accurate time type in java?

I want to compare the performance of certain operations in my application. Other than using the Date object, is there anything more precise? ...

Linq, Left Join and Dates...

So my situation is that I have a linq-to-sql model that does not allow dates to be null in one of my tables. This is intended, because the database does not allow nulls in that field. My problem, is that when I try to write a Linq query with this model, I cannot do a left join with that table anymore because the date is not a 'nullable...

Noob need help in age calculation

This query method works : SELECT xxx FROM xxx-table WHERE YEAR( CURRENT_DATE( ) ) - YEAR( '1988-10-27' ) - ( DATE_FORMAT( CURRENT_DATE( ) , '%m-%y' ) < '12-31' ) Between 20 and 25 But what I need is something like this... SELECT YEAR( CURRENT_DATE( ) ) ...

How do I get the current date?

How can I get the current date, and format it like "20/12/2010"? Thanks in advance..:) ...

GWT java.util.Date serialization bug

GWT doesn't serialize Java Date properly. When I tried sending Date created in Javascript through the wire, I found out that dates between April 1st (funny) and 25th October for years before year 1983 get subtracted by one day. That means that, say, both 1982-04-01 and 1982-03-31 become 1982-03-31 on the Java side. Given the dates in q...

Will the MySQL datetime format work with SQLite and PostgreSQL?

In MySQL you enter dates (datetime field) in the format 2009-10-16 21:30:45. Which makes it simple to insert times into the database. $date = date('Y-m-d H:i:s', $timestamp); Will this format work with SQLite and PostgreSQL? If not, what format do they use? ...

jquery datepicker inputdate highlight

Hi there, I am using latest version of 'Jquery-ui' datepicker. i am trying to make the datepicker readonly(no more selections) with a given input date highlighted. i did not find any way to make it readonly but i was able to highlight a given date to some extent (though today's date appears to be more highlighted). my code looks: $(...

SQL date Statement

Hi, I need some help figuring out and SQL Statement. I know what I want I just cant express it. Im using php, so it doesnt need to be exclusivly SQL, its to act as a filter. Pseudo code $query="SELECT * FROM MyTable WHERE 'TIS' is not older than 2 days or empty = ''$ORDER"; } TIS in the name of the column in my table were I stor...

iphone: How do you find the creation date of a file?

hi all. I'm trying to find the creation date (NOT modification date) of a file. Creation date doesn't appear to be in the attributes of a file, though modified date is. I'm using this code.. NSFileManager* fm = [NSFileManager defaultManager]; NSString* path = [PathHelpers pathInDocumentsFolderWithFilename:FILE_NAME]; NSDictionary* a...

What could cause this SimpleDateFormat formatting error?

I have a date stored as a java.sql.Timestamp in a database. The date is "2010-01-20T19:10:35.000Z" and is equivalent to 1264014635743 ms. Somehow, the date is formatted differently on the prod machine compared to the dev machine. The code to format the date is: private final static String DATE_FORMAT = "yyyy-MM-dd"; public final stati...

Comparing Dates in yyyy-mm-dd format

There's a query I'm working on that has ... WHERE start_date >= DATE(NOW()) AND end_date >= DATE(NOW()) start_date/end_date are in the date format: yyyy-mm-dd What kinds of results should be expected from this kind of query? ...

PHP - Compare Date

I have following $var = "2010-01-21 00:00:00.0" I'd like to compare this date against today's date (i.e. I'd like to know if this $var is before today or equals today or not) What function would I need to use? ...

date format in msbuild script?

In my msbuild script I'm creating a zip file with year/month/day in the zip filename, but month and day are always written with no leading zero. Is there a way to add leading zero to my zip filename? <Time> <Output TaskParameter="Year" PropertyName="Year" /> <Output TaskParameter="Month" PropertyName="Month" /> <Output TaskParame...

LaTeX command for last modified

Is there a LaTeX command that prints the "last modified" date of the actual document? Since LaTeX projects consist of more than one file this command ideally prints the date of the actual file, not that of the project. ...

PHP date formatting

I want to transform a date from this format: 01/07/09 to this jan 07,09. How can I do that in PHP? ...

MySQL - SELECT WHERE date < X

How do I do this in MySQL? SELECT * FROM MyTable WHERE MyDateCol < TODAY() I googled a lot on the subject and didn't really find anything except "look in the MySQL date ref" which does not explain the above easily enough. I know I can do the following which is kinda indirect: SELECT * FROM MyTable WHERE MyDateCol BETWEEN (0000-00-0...