Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Lost in DateTime !

by 1nickt (Canon)
on Jun 13, 2017 at 23:35 UTC ( [id://1192749]=note: print w/replies, xml ) Need Help??


in reply to Lost in DateTime !

In my experience it's always best to convert dates and times to epochtime before storing in the DB. Then convert them to some other format when you want to use or display them. As your app grows you'll often find that you need more than one human-readable format, and if you are converting from one format to another at the app level, doing all the conversions from epoch time is easier. Also the dates/times can be sorted numerically.

Some would say you shouldn't be doing processing in your app that could be handled at the DB layer. Yes, it's true that your DB can handle dates, and probably even provides date/time functions. But you have Perl! Store the simplest representation of your data in the DB and do your processing in Perl, and you will die a happy monk.

Hope this helps!


The way forward always starts with a minimal test.

Replies are listed 'Best First'.
Re^2: Lost in DateTime !
by pcouderc (Monk) on Jun 14, 2017 at 06:16 UTC
    Thank you, please see just above.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-04-24 19:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found