Page 1 of 1
How to put system time into hh:mm:ss [SOLVED]
Posted: Thu Jan 01, 2015 12:20 pm
by morrell
How can I get the system time to display in 24 hours with hh:mm:ss which at the moment my
Code: Select all
put the system time into field "SThhmmss"
is not giving me what I want.
Example:-
I need 3 am. to display as 03:00:00 and 3 pm. to display as 15:00:00
Regards,
Ruth
Re: How to put system time into hh:mm:ss
Posted: Thu Jan 01, 2015 12:26 pm
by Dixie
Code: Select all
on mouseUp
set the twelvehourTime to false
put the long time
end mouseUp
Re: How to put system time into hh:mm:ss
Posted: Thu Jan 01, 2015 1:43 pm
by morrell
Thank you Dixie.
After adding your code to mine:-
Code: Select all
on mouseUp
set the twelvehourTime to false
put the long time
put the system time into field "SThhmmss"
end mouseUp
Whilst my field does now show the hh:mm:ss as I wanted, I now have a message box appear which I don't want. What do I add or change for no message box to appear?
Regards,
Ruth
Re: How to put system time into hh:mm:ss
Posted: Thu Jan 01, 2015 2:46 pm
by Dixie
Ruth..
try
Code: Select all
on mouseUp
set the twelvehourTime to false
put the long time into field "SThhmmss"
--put the system time into field "SThhmmss"
end mouseUp
Re: How to put system time into hh:mm:ss
Posted: Thu Jan 01, 2015 3:11 pm
by morrell
That corrected it Dixie and many thanks.
Regards,
Ruth
Re: How to put system time into hh:mm:ss
Posted: Fri Jan 02, 2015 2:10 am
by morrell
When I said it was corrected in my previous answer we were on PM time and unfortunately when midnight passed it then displayed as h:mm:ss and not hh:mm:ss
Regards,
Ruth
Re: How to put system time into hh:mm:ss
Posted: Fri Jan 02, 2015 2:37 am
by dunbarx
Ruth.
Can you write the couple of lines of code that pad the hours portion of the time with a "0" if it needs one? In other words, can you make "1" into "01"? Do you know about the itemDelimiter, and how it might be used for this?
Craig Newman
Re: How to put system time into hh:mm:ss
Posted: Fri Jan 02, 2015 7:51 am
by Dixie
Hi Ruth...
This will correct it...
Code: Select all
on mouseUp
set the twelvehourTime to false
put the long time into tempTime
if the number of chars of tempTime = 7 then
put 0 & tempTime into tempTime
end if
put tempTime into fld "SThhmmss"
end mouseUp
Re: How to put system time into hh:mm:ss [SOLVED]
Posted: Fri Jan 02, 2015 9:28 am
by morrell
Thank you dunbarx and Dixie.
Regards,
Ruth