Help With Time Formats: UT, GMT, DST ,...

I am pulling my hair out trying to create an RSS feed with appropriate date and time filelds. I was up to 04:00 AM and now am too punchy to think remotely straight.

  1. In a date/time in the format (I think this is RFC822):

Wed, 18 Oct 2006 12:48:58 -0700

Does that indicate a local time of 12:48:58 in a timezone 7 hours behind GMT (LA Time), or a GMT time of 12:48:58 that you have to subract 7 hours from if you want to display it in Los Angeles?

  1. When LA changes to to PST do I then change -0700 to -0600, or will date SW do the appropriate stuff for me?

  2. What’s the diff between UT and GMT?

Wouldn’t that be only for DST? The US Pacific coast is only -0700 during the summer but reverts back to -0800 once Daylight Saving ends.

Source: Greenwich Mean Time - Wikipedia

For your example 12:48:58 is the local time, which is 7 hours behind UTC. To get UTC, add 7 hours.

Whether the time offset will automatically switch for DST depends on the software you’re using to generate the datetime string. The standard Unix ‘date’ command should automatically adust for DST, assuming your system timezone environment has been properly set up.

Thanks