Click here to Skip to main content
15,895,084 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: It's about TIME for a programming question Pin
Brisingr Aerowing28-Jul-16 6:11
professionalBrisingr Aerowing28-Jul-16 6:11 
GeneralRe: It's about TIME for a programming question Pin
Foothill28-Jul-16 4:03
professionalFoothill28-Jul-16 4:03 
GeneralRe: It's about TIME for a programming question Pin
Marc Clifton28-Jul-16 5:14
mvaMarc Clifton28-Jul-16 5:14 
GeneralRe: It's about TIME for a programming question Pin
Richard MacCutchan28-Jul-16 4:25
mveRichard MacCutchan28-Jul-16 4:25 
GeneralRe: It's about TIME for a programming question Pin
Marc Clifton28-Jul-16 5:15
mvaMarc Clifton28-Jul-16 5:15 
GeneralRe: It's about TIME for a programming question Pin
kmoorevs28-Jul-16 4:44
kmoorevs28-Jul-16 4:44 
GeneralRe: It's about TIME for a programming question Pin
Marc Clifton28-Jul-16 5:16
mvaMarc Clifton28-Jul-16 5:16 
GeneralRe: It's about TIME for a programming question Pin
Rob Philpott28-Jul-16 4:59
Rob Philpott28-Jul-16 4:59 
I think dealing with time in code is one of the hardest things I've worked on, and I still don't know what the best solution is. I've done it a lot over the years.

To avoid daylight saving issues, I tend to store everything in UTC (or GMT to give it its correct title!), then do local conversion. If everything feeds in UTC then at least the same DateTime refers to the same moment wherever you are. But if you have any scheduled tasks, these will need to be rescheduled twice a year as you enter and exit daylight saving.

The main problem is that other people don't (use UTC), DateTime.Now is too easy, and this humble type's 'kind' only tells you whether it is UTC/local etc, but not where local is. By the time its gone in and out of SQL server it might have been the time on the moon for all its worth.

Then there's UTC to local time and back conversion which is not that easy.

Hmmmmm, I don't know where I'm going with this - not a clue. Horrible. But good luck..!
Regards,
Rob Philpott.

GeneralRe: It's about TIME for a programming question Pin
Marc Clifton28-Jul-16 5:17
mvaMarc Clifton28-Jul-16 5:17 
GeneralRe: It's about TIME for a programming question Pin
Brisingr Aerowing28-Jul-16 6:13
professionalBrisingr Aerowing28-Jul-16 6:13 
GeneralRe: It's about TIME for a programming question Pin
Vikram A Punathambekar28-Jul-16 7:20
Vikram A Punathambekar28-Jul-16 7:20 
GeneralRe: It's about TIME for a programming question Pin
Clifford Nelson28-Jul-16 5:08
Clifford Nelson28-Jul-16 5:08 
GeneralRe: It's about TIME for a programming question Pin
Marc Clifton28-Jul-16 5:18
mvaMarc Clifton28-Jul-16 5:18 
GeneralRe: It's about TIME for a programming question Pin
Clifford Nelson28-Jul-16 5:28
Clifford Nelson28-Jul-16 5:28 
GeneralRe: It's about TIME for a programming question Pin
WiganLatics28-Jul-16 5:12
professionalWiganLatics28-Jul-16 5:12 
GeneralRe: It's about TIME for a programming question Pin
Marc Clifton28-Jul-16 5:19
mvaMarc Clifton28-Jul-16 5:19 
GeneralRe: It's about TIME for a programming question Pin
patbob28-Jul-16 5:46
patbob28-Jul-16 5:46 
GeneralRe: It's about TIME for a programming question Pin
ledtech328-Jul-16 6:15
ledtech328-Jul-16 6:15 
AnswerRe: It's about TIME for a programming question Pin
Jeremy Falcon28-Jul-16 6:38
professionalJeremy Falcon28-Jul-16 6:38 
GeneralRe: It's about TIME for a programming question Pin
Pablo Aliskevicius28-Jul-16 6:44
Pablo Aliskevicius28-Jul-16 6:44 
GeneralRe: It's about TIME for a programming question Pin
Ryan Peden28-Jul-16 6:55
professionalRyan Peden28-Jul-16 6:55 
JokeRe: It's about TIME for a programming question Pin
Nish Nishant28-Jul-16 7:49
sitebuilderNish Nishant28-Jul-16 7:49 
GeneralRe: It's about TIME for a programming question Pin
Marc Clifton28-Jul-16 9:16
mvaMarc Clifton28-Jul-16 9:16 
GeneralRe: It's about TIME for a programming question Pin
Worried Brown Eyes28-Jul-16 11:32
Worried Brown Eyes28-Jul-16 11:32 
GeneralRe: It's about TIME for a programming question Pin
Gaston Verelst28-Jul-16 20:27
Gaston Verelst28-Jul-16 20:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.