gmt

NSDate - GMT on iPhone

I have the following code in a production application which calculates a GMT date from the date the user enters: NSDate *localDate = pickedDate; NSTimeInterval timeZoneOffset = [[NSTimeZone defaultTimeZone] secondsFromGMT]; // You could also use the systemTimeZone method NSTimeInterval gmtTimeInterval = [localDate timeIntervalSi...

Force Java timezone as GMT/UTC

Hi. I need to force any time related operations to GMT/UTC, regardless the timezone set on the machine. Any convenient way to so in code? To clarify, I'm using the DB server time for all operations, but it comes out formatted according to local timezone. Thanks! ...

How to get #entries of last hour in MySQL, correcting for timezone?

I am storing activity entries in a MySQL table. The table has a date_created field of type timestamp and through PHP I insert the activity entries based on GMT: $timestamp = gmdate("Y-m-d H:i:s", time()); This works fine. On my client I am on GMT+2. If it is 16:00 here and I insert an entry, it is stored in MySQL as 14:00. This is as ...

How to make Date locale-independent?

I have a db, that stores dates in OleDateTime format, in GMT timezone. I've implemented a class, extending Date in java to represent that in classic date format. But my class is locale-dependent (I'm in GMT+2). Therefore, it converts the date in the db as date - 2 hours. How do I make it convert the date correctly? I want my class to be ...

UNIX timestamp always in GMT?

UNIX timestamp always in GMT? I tried to run php function time() and when I tried to convert the unix timestamp from the time() function, the output is not similar to the computer time. Thank You ...

Convert historic dates from utc to local time

I have an sql table with data like this: | theDate (datetime) | theValue (int) | ---------------------------------------- | 2010-05-17 02:21:10 | 5 | | 2009-03-12 04:11:35 | 23 | | 2010-02-19 18:16:53 | 52 | | 2008-07-07 22:54:11 | 30 | The dates are stored in UTC format in a datetime ...

How to get the current time in GMT?

Possible Duplicate: How can I get the current date and time in UTC or GMT in Java? I want to get the current timestamp in GMT; any ideas how to do that? ...

How can I calculate new time zone in python ?

Hello, Lets say I have a time 04:05 and the timezone is -0100 (GMT) I want to calculate the new time which will be 03:05 Is there any function in python to do that calculcation ? Thanks ...

How to Convert to UTC

I'm getting dates & times from various sources (e.g. file's date/time from FTP server, email's date/tiem received, etc.) and need to store them all as UTC (so they all have a common reference). How do I do this? What pieces of information do I need in order to properly do the conversion. This is for a PHP web application. So, I can get ...

HOW TO GET: Time Zone Setting of FTP Server?

I'm using PHP's ftp_rawlist function to get a listing of files and their associated last-modified date/time. For my purposes, I need to know the time zone (or offset) of the the last-modified date/time. The dates/times alone are useless to me as I need to convert them to UTC. Is there anyway to figure out what the FTP server's time zone...

Web Service to Get Current UTC Time?

I'm building a PHP web application and need to know what the current date/time is. I cannot depend on the server's setting. Any web service I can use? I know there will be some delay accessing the time via web service, but I am fine with something that is not accurate to the last millisecond. ...

validate time GMT offset and striping with regex ?

// create a string $string = '+7'; // try to match the beginning of the string if(preg_match("{-15 to +12}", $string)) { // if it matches we echo this line return {strip all the + sign} echo 'its a valid gmt time'; } else { echo 'not valid gmt time'; } Question: please see the first {} on preg_match, ...

How to display all datetime on website in user's GMT locale?

Hello, I store all datetime values as unix timestamp. Registered users can set personal GMT locale in their profile. What should I do to display all datetime on website in user's GMT locale? Thank you ...

MySQL default time format UTC or GMT ?

Hi I'm so confused with this UTC and GMT I'm inserting in MySQL table as ex column "event_date" like "2010-07-01 23:50:00" (datetime) my client asking an option in front end as GMT +1 GMT +2 GMT -1 GMT -2 ...etc if I select any option GMT +2 the event_date will filter/list according to the GMT +2. I have no idea how to proceed and aft...

Log4J; how to ensure timestamps are always in GMT using ConversionPattern?

How can I ensure that all timestamps that my log4j is using, are in GMT? I have tried the following but it prints "GMT" inside the timestamp log4j.appender.ConversionPattern=%d{HH\:mm\:ss,SSS}{GMT} %-4r %-5p [%t] %3x - %m%n ...

Absolute GMT date on iPhone

I'm trying to get a date that represents noon GMT for a recurring local notification. I need this local notification to fire at the exact moment to anyone using the app. So far, I'm trying this: NSCalendar *calendar = [NSCalendar currentCalendar]; NSDateComponents *dateComps = [[NSDateComponents alloc] init]; [dateComps setHour:12]; [...

PHP Timezones getTransitions trustworthy?

Have you ever had any issue with PHP timezones conversions through the getTransitions function? I am trying to convert an Argentinian date into GMT. If I look into the array of transitions, I get: .... [63] => Array ( [ts] => 1287284400 [time] => 2010-10-17T03:00:00+0000 [offset] => -7200 [isdst] => 1 [abbr] => ARST ) [64] => Array ( [...

Get the GMT time given date and UTC offset in python

I have a date string of the following format '%Y%m%d%H%M%S' for example '19981024103115' and another string of the UTC local offset for example '+0100' What's the best way in python to convert it to the GMT time So the result will be '1998-10-24 09:31:15' ...