[Time Zone] Timezone Offset

[Time Zone] Timezone Offset

Forge Component
Published on 11 Oct (12 days ago) by André Vieira
4 votes
Published on 11 Oct (12 days ago) by André Vieira
Is there a way it could include the timezone offset from UTC?? Best if it's in ISO8601 format:


Hi Gino,

I didn't quite understand your question :(
What is your use case?
Sorry for that. I was looking for an output of something like this one: 2014-07-08T16:00:33+08:00. I just found out that you can output the UTC offset though, and since the offset is separate and cannot be included in the DateTime output maybe I'll just do some customization and have it output in the format I mentioned above. :)

Did I make it clear? Sorry

Yes that is clear now.

Since the output is a structure you can create a string with the format you mentioned...

Thanks Andre!

Btw, on GetCurrentTimeZone() is this based on my browser, computer or server settings?



The GetCurrentTimeZone is based on the server not the client.
hey Andre,
could you please tell me how to get my personal timezone (defined while creating my user) . if i am accessing the website from a different time zone , then how could i get my timezone in the website ?
Hi leo,

Timezone information is not send in HTTP Headers so it is not possible to determine it on server side. I didn't try it out but it seems you can do it with javascript, check here: https://bitbucket.org/pellepim/jstimezonedetect
thanks Andre, 
but the link you  provided has informaton pertaining to device time zone.. it will not work if i am accessing website from an internet cafe / organization in a different country..

since my profile has my timezone information in database, so i guess i can manage the code to convert it via GEO component....but this is again a pain since i have to change the logic throughout the site where i am displaying the date. is there a way i can do it centralized ? what is your suggestion?
I'm sorry leo, now I don't understand what you want to do :(

This component allows you to get the current timezone of the server that is running the application. It will also allow you to convert that timezone to another timezone. On this case you can convert it to a timezone you have recorded somewhere (e.g. user profile) or that you can get from the device (via javascript).

This last option allows to, despite wherever in the world you are accessing your application you will be able to see time information in that timezone, imagine you have a calendar application and you travel to a different timezone, it would be helpful to see the calendar according to that timezone.

Regardless of the way you want to implement your application (use client side or profile) you can not change the timezone on the server, you will have to code in your application all the needed conversions between timezones, your's and server's.
ok Thank you for your suggestion . :)