Use Now() on a DateTime Column and Return 12 Hour instead of 24 hour

Hello All,

Wondering what Im missing,

Im trying to Get my DateTime Column which has an initial value of Now() to return the Time in 12 hour format 3:57 pm instead of 15:57.

Is there a setting Im missing somewhere?

The Reason I’m so confused is I have other apps that I dont think have anything differant and they return the time in 12 hour format???

From searching etc I know there were some bugs here at some point but this was over a year ago,

Any pointers would be great

Thanks,

You can enclose your initial value with TEXT() function.

TEXT(NOW(), "MM/DD/YYYY HH:MM")

Yes I tried that but it doesn’t seem to have an effect. wondering if still bugs surrounding this?

@Jonathan_S
Weird really. Provided you are using long date format, presumably you may need to set it off as well. Seems working actually:

Yeah, Tried that as well, not working.

If I have 2 seperate Columns, Date and Time, How would I turn them into a Date Time?

DATETIME([Date]&" "&[Time])

and actually this should work as well:

TEXT(DATETIME([Date]&" "&[Time]), "MM/DD/YYYY HH:MM")

DATETIME([Date]&" "&[Time]) thihs just put the 12 hour time back into 24 hour format

TEXT(DATETIME([Date]&" "&[Time]), “MM/DD/YYYY HH:MM”) also puts time 24 hour format

Both in long date format enabled and disabled.

Scratching my Head.

@Aleksi

Jonathan_S:

TEXT(DATETIME([Date]&" "&[Time]), “MM/DD/YYYY HH:MM”)

@Jonathan_S
This will produce 12hr format if that’s what you want. Do apologize for my misunderstanding.
TEXT(DATETIME([Date]&" "&[Time]), “MM/DD/YYYY H:MM AM/PM”)

TEXT(DATETIME([Date]&" "&[Time]), “MM/DD/YYYY H:MM AM/PM”) Also Still outputting 24 hour format. Not exactly sure anymore.

So If I test the Formula it is also good,

But in the acualy Column and output in the app Im getting this.

Also in the app it is displays in 24 hour time.

In your gSheet, select the [Time] column entirely, choose Format > Number > More formats > More Date and Time formats

You may apply Custom format for the DateTime column. Just enter the string “MM/DD/YYYY H:MM AM/PM”

Same Thing Changes everything in spreadsheet but not in app.

also Date Time Column is still the same, also cant find an option to display in 12 hour format with datetime in g Sheet.

@Jonathan_S
Can you share your gSheet with edit access for a moment with levent@able3ventures.com? I would like to check that.

Done

@Jonathan_S
I have made my changes and left a comment for you with creating another alternative method as well where I have explicity created Another_Option_For_DateTime sheet for that purpose. Check the sheet formula in [D1] and notice my comment there.

thank you Kindly :).

This will work, but i will continue working on this item once i get more of the larger stuff covered off. Really bugs me. I have other apps that use 24 hour DateTime Directly in the app just fine just by using Now() in the initial formula.

@Jonathan_S
As long as the format in your gSheet and the format in the app matches, there’s no problem. For the Date, Time and DateTime values, AppSheet generally uses 12hr format by-default. However it can be easily changed to reflect 24hr format with the TEXT() function.

As AppSheet parses sheet data via Sheet API, no matter what your in-app format is, the API respects the number/cell format of the sheet when parsing. Therefore it’s a major point to match the AppSheet column types/base types and formatting with the number/cell formatting of the gSheet as a best practice.