Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^4: Timezone Conversion

by MidLifeXis (Monsignor)
on Oct 28, 2015 at 13:43 UTC ( [id://1146269]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Timezone Conversion
in thread Timezone Conversion

I begrudgingly accepted the increased computation cost of two conversions for code that was easier to read and maintain.
I have found over time that I normalize input (in this case local TZ => UTC), and regionalize output (UTC => local TZ) -- all data inside of the system is in normalized form. Needing to deal with only one TZ internally to the system is much easier than dealing with unnormalized data anywhere it is encountered.

--MidLifeXis

Replies are listed 'Best First'.
Re^5: Timezone Conversion
by marinersk (Priest) on Nov 16, 2015 at 22:01 UTC

    In retrospect, all systems I've worked on since then either were, or were adjusted to be, following your approach. I can't think of a single exception.

    Ultimately, if you do any time calc with the data, you wind up saving computation time by keeping everything "native" to UTC.

    So the perception of increased computational cost simply because I was handling a both-sides-now case were exactly that -- perception.

Re^5: Timezone Conversion
by oiskuu (Hermit) on Nov 16, 2015 at 23:16 UTC

    Concur. It's simply called abstraction (cf ISO OSI layering). Keeping time is one problem, presenting it is another.

    Abstraction empowers (when done right). For example, manufacturers of common PC timer hardware could have added the functionality for synchronizing to radio signals. "Could". All those op systems that allowed, or even considered, setting RTC to localtime, were disgracefully short-sighted.

    (Come to think about it, the standard UNIX utilities/pagers ought to have had standard options for recognizing logfile timestamps and rendering them human-readable.)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1146269]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-24 03:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found