Old 23rd May 2019, 12:34   #1
meoit
Member
 
Join Date: Oct 2014
Location: $DESKTOP
Posts: 90
Post NSIS how to convert datetime of WMI

I am query WMI, result the datetime is 20190523000000.000000+****

How to convert this result to format dd/MM/YYYY ?

Thanks.
meoit is offline   Reply With Quote
Old 23rd May 2019, 12:55   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,165
That looks like a standard YYYYMMDD ISO date, just use StrCpy to extract the parts you need by using the maxlen and start parameters.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 24th May 2019, 01:00   #3
meoit
Member
 
Join Date: Oct 2014
Location: $DESKTOP
Posts: 90
Thanks Anders.

StrCpy $0 '$R2' 2 6
StrCpy $1 '$R2' 2 4
StrCpy $2 '$R2' 4
StrCpy $out '($0/$1/$2)'
meoit is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump