date-time

What is the Best Way to Represent Summer Time Rules?

I need to store the summer time (daylight saving time) change-over rules for different world regions in a database. I already have a way of storing regions and sub-regions (so the whole "half of Australia"/Arizona/Navaho problem is taken care of), but I'm wondering what the most efficient schema would be to accomplish this. The two opt...

Calculate time elapsed from log timestamps using Ruby

I am parsing a log and would like an elegant way of calculating the difference between these time stamps shown below: [Mar 2, 2010 1:54:40 AM] [Mar 4, 2010 10:54:40 PM] I've looked at DateTime however I wasnt sure if it was ncessary to seperate the Date from the actual time part and create a Time object. If there is an easier way plea...

Using time facets on universal_time

Hi all, on boost, to create a time facet to format an specified time we use the folowing: boost::local_time::local_time_facet* facet = new boost::local_time::local_time_facet("%Y%m%d %H:%M:%S.%f"); std::stringstream date_stream; date_stream.imbue(std::locale(date_stream.getloc(), facet)); date_stream << boost::local_time::local_microse...

converting a timestring to a duration

Hi, At the moment I am trying to read in a timestring formatted and create a duration from that. I am currently trying to use the boost date_time time_duration class to read and store the value. boost date_time provides a method time_duration duration_from_string(std::string) that allows a time_duration to be created from a time strin...

What time/date do you stamp your deployed data/exe files when they appear on the target system?

It seems a good and clean thing to ensure that your deployed files appear on the target system with a consistent time/date. Many Applications seem to do this but other than for care of overwriting Users' existing data I guess it has no real significance. I'm having a purge on my installer packaging and I'd like to know if there any good ...

date_format in mysql select statement

Hi, I have date stored in my mysql table as "2010-01-01 01:01:01" but when i query the date with date_format command like DATE_FORMAT( date_created, '%%m-%%d-%%y (%%h:%%i %%p)' ) as cdate I am getting a converted date basing on mysql system timezone.. i.e. few hours difference.. for that i have used query : "SET GLOBAL time_zo...

how to efficiently parse date time (boost)

I have a char * with a date string I wish to parse. In this case a very simple format: 2010-10-28T16:23:31.428226 (common ISO format). I know with Boost I can parse this, but at a horrible cost. I have to create a string-stream, possibly a string, and then copy data back and forth. Is there any way to parse the char * without allocating...