I have searched on internet but unable to find this answer for this specific question.  This question is different from others because we don't know whether parsing string contains EST, PST at compile time. I am parsing RSS Feed's for a lot of sites and expecting pub date of some RSS in this format I want to parse this kind of format  Wed, 02 Oct 2002 08:00:00 EST   The problem is that i can not parse EST, PST etc when they come on run time.  The only solution left is to use a switch  like this  so when PST comes at the end of string, i use forexample   string TimeZone="";  string LastThreeChar=raw.substring(raw.length-4,3);  switch(LastTHreeChar)   {      case 'PST':      TimeZone= "Pacific Standard Time";      break;    }   TimeZoneInfo tzi = TimeZoneInfo.FindSystemTimeZoneById(TimeZone);   Kindly help me.
32919
I'm trying to parse an international datetime string similar to:  24-okt-08 21:09:06 CEST   So far I've got something like:  CultureInfo culture = CultureInfo.CreateSpecificCulture("nl-BE"); DateTime dt = DateTime.ParseExact("24-okt-08 21:09:06 CEST",     "dd-MMM-yy HH:mm:ss ...", culture);   The problem is what should I use for the '...' in the format string? Looking at the  MSDN page doesn't seem to list a format string for parsing timezones in PST/CEST/GMT/UTC form.
18574
I'm trying to convert a date string into an age.  The string is like: "Mon, 17 Nov 2008 01:45:32 +0200" and I need to work out how many days old it is.  I have sucessfully converted the date using:  &gt;&gt;&gt; time.strptime("Mon, 17 Nov 2008 01:45:32 +0200","%a, %d %b %Y %H:%M:%S +0200") (2008, 11, 17, 1, 45, 32, 0, 322, -1)   For some reason %z gives me an error for the +0200 but it doesn't matter that much.  I can get the current time using:  &gt;&gt;&gt; time.localtime() (2009, 2, 3, 19, 55, 32, 1, 34, 0)   but how can I subtract one from the other without going though each item in the list and doing it manually?
51934
A few months ago I was introduced to the new  type and was glad 's flaws with regard to time zones were finally taken care of.  However, I was left wondering if there were any overhead or problems that could occur from using this new type.  I work on a multi-locale web application. Does anyone know of anything that could sway me from just using it for all my date/time work? Is there a window for abuse here?  Reference:
92316
I am working on a formula based on a date/time value to extract the time for the field. This field is based on the Pacific Time Zone and as is appears as  04/04/2016 9:00 PM  I set up this formula below  LEFT(RIGHT(text(  HOC__End_Date_Time__c ),9),7)  However the return result is based on GMT and returns based on a 24-hour clock, is there a way to adjust so it can simply display as 9:00 PM rather than as 24:00.  Hope it helps.
1793
Is there a standard way for a web server to be able to determine a user's timezone within a web page?   Perhaps from an HTTP header or part of the user-agent string?
99102
Im trying to format this String into DateTime.  String     2019-01-03T00:26:01.711-02:00   Code   String data = '2019-01-03T00:26:01.711-02:00';  Datetime dt = DateTime.parse(data);   Exception     System.TypeException: Invalid date/time: 2019-01-03T00:26:01.711-02:00
21012
[Running Ubuntu Gnome 15.10]  I recently brought my computer from PST to EST in North America.  Once in EST my laptop did not update the timezone.  I tried toggling the "Auto Time Zone" switch which had no effect.  Finally, I rebooted the machine which also didn't have an effect.  Running /usr/lib/geoclue-2.0/demos/where-am-i doesn't return any result.
106168
I need to add 30 minutes to values in a Oracle date column.  I do this in my SELECT statement by specifying   to_char(date_and_time + (.000694 * 31)  which works fine most of the time.  But not when the time is on the AM/PM border.  For example, adding 30 minutes to 12:30 [which is  PM] returns 1:00 which is AM. The answer I expect is 13:00.  What's the correct way to do this?
35028
I want the server to always serve dates in UTC in the HTML, and have JavaScript on the client site convert it to the user's local timezone.  Bonus if I can output in the user's locale date format.
82739
In an application when you are showing a date to someone (and you don't know their preferred format), what date format should you use?  USA or Rest-of-the-world?     For reference if anyone is not sure what these formats are, today's date would be:   USA = 10/07/2011 or October 7, 2011   Rest-of-the-world = 07/10/2011 or 7 October 2011   Assuming an equal probability that a user is from the USA or outside the USA, which format should I use?  Note, this question was largely triggered by the comments in .
1235
I have a server running with the timezone set to UTC. It seemed like that was generally a good practice (please correct me if I'm wrong).  Anyhow, one of the servers I connect to, in order to scp files, is running on EDT and stores files that I need to copy in the format /path/to/filename/data20120913  I looked at trying to rsync files using something like find's -mtime -1 flag for files modified in the last day, but I didn't have any luck.  I don't mind just using scp to copy the current day's file, but as of right now there is a 4-hour window where running date +%Y%m%d will give a different day on each server and that bugs me a little.  Looking through man date I see that I can have the time output as UTC, but I don't see a way to have it output as another timezone like EDT  I suppose I could also use something like the GNU date extension date -d 20100909 +%s to get the date in seconds from the epoch, apply a manual 4 * 60 * 60 second calculation, and see about rendering that as a date - but then when daylight time kicks in it will still be an hour off.  Is there a simpler way to output the date in a YYYYMMDD format for EDT on a server that is set to UTC ?
41596
I'm officially breaking up with Salesforce Date parsing. This has got to be the most frustrating thing.  I have the following date in a JSON string (full JSON below):     2017-06-03T10:34:24.000Z   But when I try to deserialize the data:  Opportunity[] results = (List&lt;Opportunity&gt;)JSON.deserialize(res, List&lt;Opportunity&gt;.class);   I get the following error:     System.JSONException: Cannot deserialize instance of date from VALUE_STRING value 2016-12-05T16:19:44.000Z   I have looked at so many date parse issues before and from what I've gathered  it must be in ISO 8601 - though ISO 8601 can take various shapes:   All of the following seem to recommend exactly what I've done          How should I format this date string?  Thank you!  Full JSON string:  [{   "name":"OpportunityABC",   "CloseDate":"2017-06-03T10:34:24.000Z",   "StageName":"Pre-Engagement",   "Amount":"4810308.0", }]
13684
I want to convert a string like this:  '10/15/2008 10:06:32 PM'   into the equivalent DATETIME value in Sql Server.  In Oracle, I would say this:  TO_DATE('10/15/2008 10:06:32 PM','MM/DD/YYYY HH:MI:SS AM')    implies that I must parse the string into one of the , and then convert using one of those codes.  That seems ludicrous for such a mundane operation.  Is there an easier way?
83136
The best I can come up with for now is this monstrosity:  &gt;&gt;&gt; datetime.utcnow() \ ...   .replace(tzinfo=pytz.UTC) \ ...   .astimezone(pytz.timezone("Australia/Melbourne")) \ ...   .replace(hour=0,minute=0,second=0,microsecond=0) \ ...   .astimezone(pytz.UTC) \ ...   .replace(tzinfo=None) datetime.datetime(2008, 12, 16, 13, 0)   I.e., in English, get the current time (in UTC), convert it to some other timezone, set the time to midnight, then convert back to UTC.  I'm not just using now() or localtime() as that would use the server's timezone, not the user's timezone.  I can't help feeling I'm missing something, any ideas?
94663
How can i convert a string like this Wed Aug 07 04:30:00 GMT 2013 to a dateTime value?
60964
I am running a Tomcat application, and I need to display some time values.  Unfortunately, the time is coming up an hour off.  I looked into it and discovered that my default TimeZone is being set to:  sun.util.calendar.ZoneInfo[id="GMT-08:00",                            offset=-28800000,                            dstSavings=0,                            useDaylight=false,                            transitions=0,                            lastRule=null]   Rather than the Pacific time zone.  This is further indicated when I try to print the default time zone's , and it comes up "GMT-08:00", which seems to indicate to me that it is not correctly set to the US Pacific time zone.  I am running on Ubuntu Hardy Heron, upgraded from Gutsy Gibbon.  Is there a configuration file I can update to tell the JRE to use Pacific with all the associated daylight savings time information?  The time on my machine shows correctly, so it doesn't seem to be an OS-wide misconfiguration.    Ok, here's an update. A coworker suggested I update JAVA_OPTS in my /etc/profile to include "-Duser.timezone=US/Pacific", which worked (I also saw CATALINA_OPTS, which I updated as well). Actually, I just exported the change into the variables rather than use the new /etc/profile (a reboot later will pick up the changes and I will be golden).  However, I still think there is a better solution... there should be a configuration for Java somewhere that says what timezone it is using, or how it is grabbing the timezone. If someone knows such a setting, that would be awesome, but for now this is a decent workaround.    I am using 1.5, and it is most definitely a DST problem.  As you can see, the time zone is set to not use daylight savings.  My belief is it is generically set to -8 offset rather than the specific Pacific timezone.  Since the generic -8 offset has no daylight savings info, it's of course not using it, but the question is, where do I tell Java to use Pacific time zone when it starts up?  I'm NOT looking for a programmatic solution, it should be a configuration solution.
22820
Currently when I execute the date command from bash I get the following displayed  Thu May 17 12:21:00 IST 2012  Below is my timezone config based on executing dpkg-reconfigure tzdata     Current default time zone: 'Europe/Dublin'   Local time is now: Thu May 17 12:32:52 IST 2012.   Universal Time is now: Thu May 17 11:32:52 UTC 2012.     Any idea how I change from IST to UTC/GMT?