Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
I have this service getprocessdata which returns START_DATE and COMPLT_DATE.
I am calling this service inside of another service that generates report where I need to display start and complete date coming from my getprocessdata service, but the date time getting returned is in utc.
I also created a demoservice where I called the same service getprocessdata and printed the start_date keeping the output set to dateTime, the output was as expected.
why is such conversion taking place.
Things I have tried:
Could someone please help me out on how to prevent this date time conversion.
Thank you in advance.
Solved! Go to Solution.
Dates are stored in UTC so it's easy to compare them when e.g. querying for a date. The format in which they were entered is not retained - as far as I know.
If you have a timezone, maybe from the user session, you can convert e.g. like this:
new Date().toLocaleTimeString('en-US',{timeZone: 'America/Denver'})
Hi @MD_10945249
You can dateFormat function to convert dateTime to formatted string
let dateTimeValue = new Date();
let result = dateFormat(dateTimeValue,"dd/MM/yyyy HH:mm");
/VR
This is to format the date but I what I want to achieve is to transform my Start_Date comming from a service that is in utc to be converted to the date and time of zone in which it was entered.
Dates are stored in UTC so it's easy to compare them when e.g. querying for a date. The format in which they were entered is not retained - as far as I know.
If you have a timezone, maybe from the user session, you can convert e.g. like this:
new Date().toLocaleTimeString('en-US',{timeZone: 'America/Denver'})
Hi @MD_10945249
The mashup will always show a date field in the current users time zone but are stored/created as UTC. If you need to display the date in the Time Zone of the user that set it I would recommend one of the following.
Then in your report you can either pull the entered date and convert based on CreatedTZ or pull the formatted value from CreatedFormated. Using the CreatedFormated property approach is assuming the date isn't changed after entered or additional update logic would be needed.
Thanks,
Travis
Hello @MD_10945249,
It looks like you have some responses from some community members. If any of these replies helped you solve your question please mark the appropriate reply as the Accepted Solution.
Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.
Thanks,
Community Moderation Team.