Format of time

Discussions about CSEntry
Post Reply
CMH
Posts: 31
Joined: April 1st, 2022, 1:54 am

Format of time

Post by CMH »

Hi
I am capturing the survey start time (ST) and end time using the following logic.

PROC ST
preproc
// Prefill field start time with current time.
if visualvalue($) = notappl then
$ = systime("HHMM");
endif

If survey starts at 8am, it provides time data as 800 when i export data in SPSS. I want to get data in time format like 08:00 (rather 800) so later on i may calculate time difference using "Date and Time Wizard" fucntion of SPSS as shown in a vidoe available at following link.

https://www.youtube.com/watch?v=NRL34hpK6-A

Any solution please.
vicente
Posts: 1
Joined: October 22nd, 2023, 11:47 pm

Re: Format of time

Post by vicente »

$=edit("99:99",systime("HHMM"));
CMH
Posts: 31
Joined: April 1st, 2022, 1:54 am

Re: Format of time

Post by CMH »

Thanks. Its working.
PHINOJOSA
Posts: 45
Joined: April 16th, 2023, 10:31 pm

Re: Format of time

Post by PHINOJOSA »

Hi

The time format as indicated in the previous post works when we want it to be automatic, but if I want to manually enter the time with that format 14:12 (24 hour format) and if the time is 8:24 it autocompletes with 0 and it's 08:24, how can I do that?

I have tried but it doesn't work, I could only do it in a 4-digit string variable and put 1412 and indicating that the two digits on the left are the hour and the ones on the right are the minutes.

Thank you
justinlakier
Posts: 152
Joined: November 21st, 2022, 4:41 pm

Re: Format of time

Post by justinlakier »

Hello,

This is a different issue. If you want the manually entered time number to fit your format, I would recommend using Hour and Minute as separate fields. You can use Subitems for this, and put the items in the same block to be concurrently displayed on Android. You can then put in your specifications for the 24 hour format in those fields' logic.

Hope this helps,
Justin
PHINOJOSA
Posts: 45
Joined: April 16th, 2023, 10:31 pm

Re: Format of time

Post by PHINOJOSA »

Hi

Thank you
Post Reply