S
Stuart Clarke
Hey all,
I was wondering if I could ask for some advice regarding dates. I have a
file that contains lots of date values formatted like so:
Sunday, 15 August 2010 05:46:50 o'clock BST
I want basically out these dates as follows, applying the necessary time
zone bias:
15/08/2010 06:46:50 (because it is BST we add the hour)
At present I am struggling a little to achieve this, in particular the
tim zone offset. At present I have the following code:
dateparts = ParseDate.parsedate("#{myDate}")
myDate =
Time.mktime("#{dateparts[0]}","#{dateparts[1]}","#{dateparts[2]}","#{dateparts[3]}","#{dateparts[4]}","#{dateparts[5]}")
myDate = myDate.strftime("%d/%m/%Y %H:%M:%S")
I am unsure, how to get from this code above to apply the relevant time
zone bias to the time as shown in the example below. My code at present
will output:
15/08/2010 05:46:50
This is not what I want because it does not understand this is a BST
time and it needs to be added by 1 hour.
I would appreciate any help.
I was wondering if I could ask for some advice regarding dates. I have a
file that contains lots of date values formatted like so:
Sunday, 15 August 2010 05:46:50 o'clock BST
I want basically out these dates as follows, applying the necessary time
zone bias:
15/08/2010 06:46:50 (because it is BST we add the hour)
At present I am struggling a little to achieve this, in particular the
tim zone offset. At present I have the following code:
dateparts = ParseDate.parsedate("#{myDate}")
myDate =
Time.mktime("#{dateparts[0]}","#{dateparts[1]}","#{dateparts[2]}","#{dateparts[3]}","#{dateparts[4]}","#{dateparts[5]}")
myDate = myDate.strftime("%d/%m/%Y %H:%M:%S")
I am unsure, how to get from this code above to apply the relevant time
zone bias to the time as shown in the example below. My code at present
will output:
15/08/2010 05:46:50
This is not what I want because it does not understand this is a BST
time and it needs to be added by 1 hour.
I would appreciate any help.