On Tue, 7 Jul 2009, David wrote:

whist using "date" in a bash script there seems to be a problem returning the hour for 09:20

t_hr=$(date +%l) (small L) does not return "9" from 09:20 or any time between 09:00 and 09:30

t_hr=$(date +%-I) works fine

I needed the hour with out the padded zero

I can't reproduce this:

$ date -d 09:00
Wed Jul  8 09:00:00 IST 2009
p...@dietofworms:~$ date -d 09:00 +%l
 9


Please try the following commands and report the results:
date --version
date 08:50 +%l
date 09:00 +%l
date 09:15 +%l
date 09:30 %+l
date 09:40 +%l
env -i date -u -d 09:00 +%l


Cheers,
Phil


_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to