Normal Topic Time Field Format (Read 688 times)
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Time Field Format
Feb 16th, 2004 at 2:55am
Print Post Print Post  
I have found that when the time is the top of the hour, I am only seeing one zero vs. two.  

Example, 4 AM shows up as 4:0 AM v. 4:00 AM.  

In Q&A I could press "4" and the result would be 4:00 AM.

In Sesame I get 4:0 AM if I press "4", or 4.0 or 4.00 or 4:00.

-------------------
And it is now necessary to enter all digits to get the correct display for perfect 10 minute times (4:20, 4:30, etc.)

In Q&A I could press 4.3 and get 4:30 AM

In Sesame if I press 4.3 I get 4:3 AM.
In Sesame if I press 4.30 I get 4:30 AM

Both of these issues appear to be a display issue only.  Calculations using the time in the fields do work correctly.

Is this a bug to be reported?
« Last Edit: Feb 17th, 2004 at 2:21am by Bob_Hansen »  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Alchemist
Member
*
Offline


No personal text

Posts: 8
Joined: Feb 5th, 2004
Re: Time Field decimals
Reply #1 - Feb 16th, 2004 at 5:04pm
Print Post Print Post  
Bob

I wasn't getting 4:3 I was getting 4:03:00 AM when entering 4.3. Check in Application Property Manager and make sure you have the correct Default Display Formats set correctly for the Field Type "Time". If you start getting what I was getting 04:03:00 AM you can try the following:
// Time element named TmElement
var vMinute as int
var vHour as string
var vNewTime as string
vNewTime = TmElement
if @len(vNewTime)>2 then
{
     vNewTime = @replace(vNewTime, ".", ":")
     VHour = @left(TmElement,@instr(TmElement,":")-1)
     vMinute = @mid(TmElement,@instr(TmElement,":")+1,2);
}
IF (vMinute)<6 then vMinute=vMinute*10
vNewTime = vHour + ":" + vMinute
TmElement = vNewTime

It was quick and doesn't address seconds but it works.
  
Back to top
 
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Time Field decimals
Reply #2 - Feb 16th, 2004 at 10:56pm
Print Post Print Post  
Thanks for hint Alchemist.

I found an easier solution in Application Property Manager by setting Custom format for time. 

Was translated from Q&A, from "4:55 pm" to a Sesame format of "2:5 PM [%#|:%#m %p]"?  This appears to be some type of internal format, I changed format for Time to Custom, 02:05 PM.  Then selected all Time fields on my forms and applied Custom format, problem solved.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged