Set time and timezone

Hello again.

I’m currently working on a project which involves time and timezones and I have two questions.

  1. How do I set a text field to display the time in 12-hour format (e.g 5:00 pm)? At the moment, I can only get it to display in its default 24-hour format (e.g 17:00).

(Note: I’ve attempted several actions using “append” and “replace” text but had issues when updating in realtime, so I’m asking for a direct route.)

  1. How do I set project timezone to another, different from local?

(Note: Also attempted several actions using “set project timezone” with argument as timezone ID e.g Asia/Tokyo; but couldn’t get it to work)

Any help would be appreciated.

Thanks a lot.

*Update

After a bit of research I was able to get a text field to display local time in 12-hour format using the “date” variable widget with argument set to “date > property > [D] VarDate > LocaleTimeString” under actions (date formatting options would have to be set to “h:m:s ap” and Init date type to “Current Date” for anyone who might need this).

However, I’m met with a newer issue: it doesn’t update in realtime (“repeat” action does not help).

So I’m open to suggestions still, thanks.

You could go to this topic, it might be a good help to you.
Date formatting

Thanks a lot for your response.

I actually visited that topic earlier. It was the source of my research.

The problem I currently face is getting the text field to update in realtime as the time changes (e.g on a per-second basis like, 8:15:01 am, 8:15:02 am, 8:15:03 am… etc)

I would think a “repeat” action would get it to work, but it doesn’t (it does when I use “project > property > datetime > timestring” as argument but only in 24-hour format).

So maybe I’m missing something.

No need for Action repeat
I made a modified version of that links project based on your example above, you’ll have an idea
formatted_datetime.pma (5.1 KB)

To update the value every second you need to use the Changed event:

image

Very much appreciated Anessi and Michael, thank you!

It worked.


Back to Flipabit >
Copyright © 2018. Flipabit Team. All rights reserved.