Problems with 12h AM/PM and milliseconds

13 views
Skip to first unread message

Jörg Buchholz

unread,
Mar 9, 2021, 9:15:29 AM3/9/21
to
Hello,

I have some Problems to read in Time/Date with 12h AM/PM and milliseconds.

These two examples works:

reset
$Data <<EOD
11:59:24 AM 1.23
11:59:59 AM 2.34
12:00:00 PM 3.45
01:01:24 PM 4.56
01:01:24 PM 5.67
EOD
set grid
myInputTimeFmt = "%H:%M:%S %p"
myOutputTimeFmt = "%H:%M\n%S"
set format x myOutputTimeFmt timedate

plot $Data u (timecolumn(1,myInputTimeFmt)):3 w lp pt 7 notitle



reset
$Data <<EOD
11:59:24.654 1.23
11:59:59.000 2.34
12:00:00.999 3.45
13:01:24.000 4.56
13:01:24.555 5.67
EOD
set grid
myInputTimeFmt = "%H:%M:%S"
myOutputTimeFmt = "%H:%M\n%S"
set format x myOutputTimeFmt timedate

plot $Data u (timecolumn(1,myInputTimeFmt)):2 w lp pt 7 notitle



This one not work correctly:

reset
$Data <<EOD
11:59:24.654 AM 1.23
11:59:59.000 AM 2.34
12:00:00.999 PM 3.45
01:01:24.000 PM 4.56
01:01:24.555 PM 5.67
EOD
set grid
myInputTimeFmt = "%H:%M:%S %p"
myOutputTimeFmt = "%H:%M\n%S"
set format x myOutputTimeFmt timedate

plot $Data u (timecolumn(1,myInputTimeFmt)):3 w lp pt 7 notitle



What is wrong?

Jörg
Reply all
Reply to author
Forward
0 new messages