Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Date manipulation
#1
Hi guys it all seems simple enough but I can't seem to figure out for the life of me how to script it.

I'm trying to get today's date, change it to tomorrow's date and out it in one field. Next change it to a year from that date and out it in another field.

Do I script this in a function or macro?

Please help, thanks in advance!
#2
Macro Macro1707
Code:
Copy      Help
DateTime x
str s
int year
x.FromComputerTime ;;get today's date time
x.AddParts(1) ;;add 1 day
s=x.ToStr ;;convert to string
;s=x.ToStr(1) ;;without time part
out s
x.GetParts(year) ;;get year
out year

or
Macro Macro1708
Code:
Copy      Help
DATE x
x.getclock
x=x+1 ;;add 1 day
;_i=x; x=_i ;;remove time part
out x
SYSTEMTIME st; x.tosystemtime(st)
out st.wYear
#3
Awesome, thanks Gintaras!


Forum Jump:


Users browsing this thread: 1 Guest(s)