dbTalk Databases Forums  

Time!

comp.databases.filemaker comp.databases.filemaker


Discuss Time! in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
marytakle@gmail.com
 
Posts: n/a

Default Time! - 07-22-2007 , 10:09 PM






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


Reply With Quote
  #2  
Old   
Howard Schlossberg
 
Posts: n/a

Default Re: Time! - 07-22-2007 , 10:55 PM






marytakle (AT) gmail (DOT) com wrote:
Quote:
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


Reply With Quote
  #3  
Old   
marytakle@gmail.com
 
Posts: n/a

Default Re: Time! - 07-22-2007 , 11:54 PM



On Jul 22, 8:55 pm, Howard Schlossberg
<how... (AT) nospam (DOT) fmprosolutions.com> wrote:
Quote:
maryta... (AT) gmail (DOT) 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



Reply With Quote
  #4  
Old   
Howard Schlossberg
 
Posts: n/a

Default Re: Time! - 07-23-2007 , 12:54 AM



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 (DOT) com wrote:
Quote:
On Jul 22, 8:55 pm, Howard Schlossberg
how... (AT) nospam (DOT) fmprosolutions.com> wrote:
maryta... (AT) gmail (DOT) 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


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.