Jump to content

Non standard date format?


Recommended Posts

Thanks, I couldn't find anything in help about getting the day though, is that possible?

@MDAY and @WDAY

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

@MDAY and @WDAY

Thanks, I had a go at getting the date/time into the format I want, this is the code.. is this the best way to do it? Or someone has a more efficient solution?

#Include <Date.au3> 

Local $numericday = @WDAY 
Local $numericdate = @MDAY 
Local $time = _NowTime(3) 
Local $ampm 
Local $datesting 

If $numericday = 1 Then 
        $textday = "Sun" 
ElseIf $numericday = 2 Then 
        $textday = "Mon" 
ElseIf $numericday = 3 Then 
        $textday = "Tue" 
ElseIf $numericday = 4 Then 
        $textday = "Wed" 
ElseIf $numericday = 5 Then 
        $textday = "Thur" 
ElseIf $numericday = 6 Then 
        $textday = "Fri" 
ElseIf $numericday = 7 Then 
        $textday = "Sat" 
EndIf 

If StringInStr($time, "a.m.", 0, 1) <> 0 Then 
        $ampm = "am" 
ElseIf StringInStr($time, "p.m.", 0, 1) <> 0 Then 
        $ampm = "pm" 
EndIf 

$time = StringTrimRight($time, 8) 

$datestring = $time & $ampm & " " & $textday & " " & $numericdate 

;Display the resulting time/date string 
msgbox(1,"",$datestring)
Link to comment
Share on other sites

Can't you just do

if @hour > 11 then
$ampm = "PM"
else
$ampm = "AM"
endif

msgbox(1, "", _NowTime(3) & $ampm & " " & StringLeft(_DateDayOfWeek, 3) & " " & @MDAY)

of course then Thursday is going to be displayed as Thu instead of Thur

My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote]
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...