Jump to content

Recommended Posts

Posted

I cannot get my script to format the year as MM/DD/YY with autoit. Everything wants to give the full YYYY. THe program I am putting a date into requires the last two digits of the year.

Thanks,

Posted

use ths

msgbox(4096,"",StringRight(@YEAR,2))
[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com
Posted

found the answer.

$date = "20/01/2009"

MsgBox (0, $date & "(dd/mm/yyyy)", _EditDate ($date) & " (yy-mm-dd)")

Func _EditDate ($datestr)

$sD = StringSplit ($datestr, "/")

$day = StringRight ($sD[1], 2)

$month = StringRight ($sD[2], 2)

$year = StringRight ($sD[3], 2)

Return $year & "-" & $month & "-" & $day

EndFunc

Posted

use ths

msgbox(4096,"",StringRight(@YEAR,2))
Manjish's example is much easier then your alternative. :)

$Date = @MONTH & "/" & @MDAY & "/" @ StringRight(@YEAR, 2)
Posted

Manjish's example is much easier then your alternative. :)

$Date = @MONTH & "/" & @MDAY & "/" @ StringRight(@YEAR, 2)
AGREED I found it before reading his post. Thanks for the help.
Posted

shall we close this then??

[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com

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
×
×
  • Create New...