in reply to Re: Simple date and time manipulation
in thread Simple date and time manipulation
The internal format is therefore best left and stored as a timestamp and converted into whatever you need upon preparing the output.
The docs at DateTime say:
use UTC for all calculationsArguably DateTime is the best for making such conversions, but yes it is a heavy and relatively slow module, but you pay that price only once at start-up.If you do care about time zones (particularly DST) or leap seconds, try to use non-UTC time zones for presentation and user input only. Convert to UTC immediately and convert back to the local time zone for presentation:
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
|
|---|