Daemonforce Posted December 3, 2005 Posted December 3, 2005 I like what flyakite does with the time function in his cd shell script but it's screwing up the first and second lines of my UI 1/4 of the time because of an extra character. I'm getting sick of making fixes each point in the day just to keep it from hurting my eyes. Is there any way to force the function into 24 hour code?
mattofak Posted December 3, 2005 Posted December 3, 2005 change your system time to 24hour time; it works for me...
Daemonforce Posted December 3, 2005 Author Posted December 3, 2005 change your system time to 24hour time; it works for me...I can't go from that. I've been doing tests in debug mode and vmware and it's the same issue. I found out a bit of code removal fixes it though. Thanks. For those wondering:# Time Function time: set hour = $timeHour #set ampm = "am" set time = "$hour:$timeminute" #if $timeHour > 12; then set hour = $timeHour - 12 #if $timeHour > 12; then set ampm = "pm" #set time = "$hour:$timeMinute:$ampm" Now I don't have to worry about it screwing up a quarter of the time. =/
LiquidSage Posted December 4, 2005 Posted December 4, 2005 just add an if statement to that.if time equal's pm, then add 12. All you need to do then is take out the am/pm in the time display.
Daemonforce Posted December 5, 2005 Author Posted December 5, 2005 It came back this morning to haunt me. The problem is I edit the script one part of the day where the time consists of no more than three digits. The objective here is forcing it into the 00:00 time mode regardless of it showing the AM/PM determination.The time hit 1:00 in the morning....*click**time character deleted*THAT p***ed me off! O_oI fixed it in a matter of minutes after looking at the script one last time.# Time Function time: set hour = "$timeHour"set time = "$hour:$timeminute" Apparently putting quotes around $timeHour fixes this entirely.Time function debugged successfully.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now