Time!
I am struggling to store time in a consistent format. I have a start
time time that is selected from a drop down list and it looks like
4:00 PM. When I save this in a record and look at the record in
"leave date formatted as entered" it looks like 4:00 PM. When I add a
10 minute increment to this number in a script (time + 600) and save
the value in the next record it looks like 16:10:00. I know I can
change the layout to show the time as 4:10 PM, but when I use this
field in an email message, is shows up as 16:10:00. How can I store
the incremented time value as 4:10 PM OR how can I force the field to
display as 4:10 PM in the email?
Thanks for your help!
Mary
Re: Time!
marytakle [at] gmail.com wrote:
> How can I store
> the incremented time value as 4:10 PM OR how can I force the field to
> display as 4:10 PM in the email?
Well, this isn't very intuitive and, in fact, I don't think it's
documented anywhere obvious. In fact, up until this moment, I always
resorted to complex calculations to get time as formatted text like this.
But thanks to your question, I just did something I'd never tried
before...and it worked!!!
Let's say your origtime is "4:00 pm". This is really stored in
FileMaker as the number of seconds since midnight (57600), though you
will never see it displayed this way in FileMaker. Instead, the default
time display, particularly after being used in a calc, is military time
(16:00:00).
That's all neither here nor there -- just for sake of your knowing.
So let's say you want to add 10 minutes to your origtime. The easiest
way is in seconds, or (origtime + 600). Well, I just discovered that
you can use the GetAsTime() function to format this as you desire. We
can express this in a Let() statement:
Let(
newtime = origtime + 600;
GetAsTime(newtime & " AM")
)
You need to always use " AM" (with the space and within quotes). It
will automatically convert it to PM if needed.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg
FM Professional Solutions, Inc. Los Angeles
FileMaker 8 Certified Developer
Member, FileMaker Business Alliance
Re: Time!
On Jul 22, 8:55 pm, Howard Schlossberg
<how... [at] nospam.fmprosolutions.com> wrote:
> maryta... [at] gmail.com wrote:
> > How can I store
> > the incremented time value as 4:10 PM OR how can I force the field to
> > display as 4:10 PM in the email?
>
> Well, this isn't very intuitive and, in fact, I don't think it's
> documented anywhere obvious. In fact, up until this moment, I always
> resorted to complex calculations to get time as formatted text like this.
>
> But thanks to your question, I just did something I'd never tried
> before...and it worked!!!
>
> Let's say your origtime is "4:00 pm". This is really stored in
> FileMaker as the number of seconds since midnight (57600), though you
> will never see it displayed this way in FileMaker. Instead, the default
> time display, particularly after being used in a calc, is military time
> (16:00:00).
>
> That's all neither here nor there -- just for sake of your knowing.
>
> So let's say you want to add 10 minutes to your origtime. The easiest
> way is in seconds, or (origtime + 600). Well, I just discovered that
> you can use the GetAsTime() function to format this as you desire. We
> can express this in a Let() statement:
>
> Let(
> newtime = origtime + 600;
> GetAsTime(newtime & " AM")
> )
>
> You need to always use " AM" (with the space and within quotes). It
> will automatically convert it to PM if needed.
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Howard Schlossberg
> FM Professional Solutions, Inc. Los Angeles
>
> FileMaker 8 Certified Developer
> Member, FileMaker Business Alliance
WOW! Thank you soooooo much! That worked! I certainly would not
have thought to add the "AM" part on my own.
Mary
Re: Time!
Nor did I for the longest time. HOWEVER -- I found afte rI posted that
there seems to be some trouble when the resulting time is in the 12:00
hour. This seems to be the only time that it matters whether your use "
AM" or " PM". But when the resulting time should be 12:00 am, the
result is a question mark. This was tested in 8.5, so perhaps it was
all fixed in 9?
marytakle [at] gmail.com wrote:
> On Jul 22, 8:55 pm, Howard Schlossberg
> <how... [at] nospam.fmprosolutions.com> wrote:
>> maryta... [at] gmail.com wrote:
>>> How can I store
>>> the incremented time value as 4:10 PM OR how can I force the field to
>>> display as 4:10 PM in the email?
>> Well, this isn't very intuitive and, in fact, I don't think it's
>> documented anywhere obvious. In fact, up until this moment, I always
>> resorted to complex calculations to get time as formatted text like this.
>>
>> But thanks to your question, I just did something I'd never tried
>> before...and it worked!!!
>>
>> Let's say your origtime is "4:00 pm". This is really stored in
>> FileMaker as the number of seconds since midnight (57600), though you
>> will never see it displayed this way in FileMaker. Instead, the default
>> time display, particularly after being used in a calc, is military time
>> (16:00:00).
>>
>> That's all neither here nor there -- just for sake of your knowing.
>>
>> So let's say you want to add 10 minutes to your origtime. The easiest
>> way is in seconds, or (origtime + 600). Well, I just discovered that
>> you can use the GetAsTime() function to format this as you desire. We
>> can express this in a Let() statement:
>>
>> Let(
>> newtime = origtime + 600;
>> GetAsTime(newtime & " AM")
>> )
>>
>> You need to always use " AM" (with the space and within quotes). It
>> will automatically convert it to PM if needed.
>>
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> Howard Schlossberg
>> FM Professional Solutions, Inc. Los Angeles
>>
>> FileMaker 8 Certified Developer
>> Member, FileMaker Business Alliance
>
> WOW! Thank you soooooo much! That worked! I certainly would not
> have thought to add the "AM" part on my own.
>
> Mary
>
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg
FM Professional Solutions, Inc. Los Angeles
FileMaker 8 Certified Developer
Member, FileMaker Business Alliance