[Time Zone] ConvertFromTimeZone

[Time Zone] ConvertFromTimeZone

  
Forge Component
(6)
Published on 24 May by André Vieira
6 votes
Published on 24 May by André Vieira
I'm using the ConvertFromTimeZone action to convert from the current system time zone, to my time zone; however, the ConvertFromTimeZone action asks for the SourceTimeZone to be in a text format. How can I get the current system's time zone into the SourceTimeZone?
Hi!

check the sample application. You have there the information about the system time zone and how to convert to other time zones. You should probably use GetCurrentTimeZone to get the system time zone...
Hi,
I'm still a bit confused. What am I supposed to write (because it asks for a Text data type):
 ConvertFromTimeZone( ,Here, And Here)
Having an example in the Action Description would be good.

Hi Carlos,

You are right! The parameters of this action are missing some description :(
These are supposed to be identifiers of the TimeZoneInfo in C#.
You can validate how to use this action in the TimeZone module:
  • Open the screen in the MainFlow.
  • Double click the expression next to the  'Converted Data Time' label.
This expression uses this action.

Hope this helps, If not please share your module so that I can have a look and see what's missing...
Cheers
André,
how exactly am I supposed to write the TimeZone name in ConvertFromUTC(DateTimeUTC,TimeZone)?

Someone told me to use the names shown here:
https://msdn.microsoft.com/en-us/library/ms912391(v=winembedded.11).aspx

I don't really think that's how it works so...
Use the test page to determine the identifier you want (http://andrevieira.outsystemscloud.com/TimeZone/)
From the drop down select the timezone you want and below you will see the identifier which is the value you should use.

Hello Andre,

how would it be in case that I have many users entering from different timezones? and How can I change the time format from YYYYMMDD HH:MM:SS to MMDDYYYY HH:MM AM/PM ?

Thanks

HI Alvaro,

You should store your dates in UTC and convert them to the timezone of each user for display only. The way you manage this can be by automatically determining the timezone from the browser or the device or by a user configuration in the backoffice. Either way, you need to program for this.

Regarding the format it is independent of the timezone conversion since the timezone returns a DateTime. You can use the FormatDateTime function for that.

Cheers

Hello

Function (GetCurrentTimeZone) does get the system time zone from the server. Any idea how to get the client time zone? Will it be the client time zone defined on the PC or derived from another parameter like the IP?

Khalil Dahham wrote:

Hello

Function (GetCurrentTimeZone) does get the system time zone from the server. Any idea how to get the client time zone? Will it be the client time zone defined on the PC or derived from another parameter like the IP?

The client time will be derived based on the Client Browser settings for the Locale of the client,


Thank you André for sharing the test page, it was very helpful. Just one question about Daylight Saving, as you know the date to change the clocks for daylight saving might be different between countries, for example Mexico changes to daylight savings one or two weeks after the US, does TimeZone takes into account the dates defined by each country, or how does it works? 

Hi Isa,

The information about daylight saving is handled by the underlying library in .NET or Java. The library reports if the timezone supports daylight saving time and if it is currently using daylight saving time. You can test this on the test page searching for "Mexico, Mexico" in the location input.