74
Views
4
Comments
Convert client system time Zone to MST
Application Type
Reactive
Service Studio Version
11.14.16 (Build 60354)

Trying to convert CurrDateTime() to MST time zone.

I am using TimeZone Component which provides various function to handle time zones. I am using these sever actions under client action which are invoked on OnReady event of page. For me these actions are not working.

GetCurrentTimeZone is returning empty value also ConverFromUTC/ConvertToUTC is returning blank values.


I am passing CurrDateTime() and "Mountain Standard Time" as parameters to ConvertFromUTC method and it is returning blank value(#1900-1-1 00:00:00#), could you please help me using this component.


2021-06-02 20-50-04
Márcio Carvalho

Can you try this answer of mine but instead of passing to CET, pass to Mountain Standard Time?

https://www.outsystems.com/forums/discussion/75682/convert-to-cet-time-zone/

Let me know if it works or if is just wrong :D

Kind Regards,

Marcio

2021-04-14 21-51-32
Malvika Singh

I want the time in MST time zone and the api seems to be working fine with postman , but when i consume the same API with outsystems it is converting the time to UTC by default. check the datetime field for postman vs Outsystems API response

2021-04-14 21-51-32
Malvika Singh

and further using GetTimeZoneDetail.TimeZoneDetail.Datetime in outsystems convert it to UTC, which is just showing me the system time and loosing the offset.

Response for MST:
{

"abbreviation": "MST",

"client_ip": "34.208.156.20",

  "datetime": "2022-06-30T10:29:09.471222-06:00",

  "day_of_week": 4,

  "day_of_year": 181,

  "dst": false,

  "dst_from": null,

  "dst_offset": 0,

  "dst_until": null,

  "raw_offset": -25200,

  "timezone": "MST",

  "unixtime": 1656606549,

  "utc_datetime": "2022-06-30T10:29:09.471222-06:00",

  "utc_offset": "-07:00",

  "week_number": 26

}


Response for MST7MDT (MDT): 

{

  "abbreviation": "MDT",

  "client_ip": "34.208.156.20",

  "datetime": "2022-06-30T10:29:56.403988-06:00",

  "day_of_week": 4,

  "day_of_year": 181,

  "dst": true,

  "dst_from": "2022-03-13T03:00:00-06:00",

  "dst_offset": 3600,

  "dst_until": "2022-11-06T01:00:00-07:00",

  "raw_offset": -25200,

  "timezone": "MST7MDT",

  "unixtime": 1656606596,

  "utc_datetime": "2022-06-30T10:29:56.403988-06:00",

  "utc_offset": "-06:00",

  "week_number": 26

}

consuming the api in outsystems give the same date time value for the MST & MDT timzones which actually have 1 hour difference

2024-11-20 08-28-20
Pedro Marques

Can you share your oml?

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.