0
Incorrect Localtime?
When I tried accessing the time (I live in Germany) via localtime function, I noticed that it is in fact two hours behind my current time. Shouldnt it return my current time, or did I mistake something? Or is there a different explanation?
3 Answers
+ 5
Where did you run the code? In your PC or the Sololearn Compiler?
The Sololearn's Server Computer, where our codes compile, has the UTC Time Zone.
+ 4
According to WorldTimeServer German timezone is UTC+2 (two hours faster)
https://www.worldtimeserver.com/current_time_in_DE.aspx
I can only suggest to lookup for timezones information and related functions for translation of UTC/GMT to your local timezone.
+ 1
@Kinshuk, yes, as I have no access to my laptop atm, I used this app to compile.
Well, that explains why localtime was similar to UTC time too, I suppose.
I already thought I mistook something about the use of localtime, thanks a lot!
I'll try it in Code::Blocks then as soon as I can...