Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 8269 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I'm trying to get text, date, and time fields into a text single. Everything works fine, but I want time displayed as "hh:mm AM/PM", it comes out in 24 hour notation w/o AM or PM. Does anyone know how to get 12 hour notation?

-Heather

Posted

No, I'm trying to incorporate the time field into the body of an email, so it needs to be in text format in a text field, mixed with several other types of data. Any ideas?

Posted

Heather,

Use this calculation for the text of a field called "Time":

code:


if(Hour(Time) > 12, Hour(Time)-12&":"&Right("00"&Minute(Time),2)&"PM",Hour(Time)&":"&Right("00"&Minute(Time),2)&"AM")

This will give you single hour figures for hours less than 10. IF you want a leading zero for the hours then use:

code:


if(Hour(Time) > 12, Right("00"&Hour(Time)-12,2)&":"&Right("00"&Minute(Time),2)&"PM",Right("00"&Hour(Time),2)&":"&Right("00"&Minute(Time),2)&"AM")

You can include this if statement in the middle of whatever else you are using to produce your final text string.

Russ

[ April 08, 2002, 07:38 PM: Message edited by: Russell Baker ]

This topic is 8269 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.