LarryO Posted April 21, 2017 Share Posted April 21, 2017 I have been using the DATE(2,0) procedure to capture the current date for our custom titleblock. What I've found after rewriting some clumsy code for our WIN10 machine that I'd originally wrote on the Mac platform is that the format delivered is reversed between the two platforms. The Mac outputs D/M/YYYY and the PC supplies YYYY/M/D. Very frustrating indeed! The Mac system option is set to display the short form day as YYYY/MM/DD as this is the desired format. Has anyone explored whether this format is set by the user at the operating system level or is it a static difference between PC and MAC platforms? [a bug? in the Date(#,#); procedure] VW2013 Quote Link to comment
JBenghiat Posted April 21, 2017 Share Posted April 21, 2017 Date() pulls from the system date format, which can vary with system and region settings. Your best solution is to use the date functions inherent in Python, which are a lot more granular and reliable. If your script is simple, converting over isn't bad, or you can call Python within VS to deal with the date. -Josh Quote Link to comment
LarryO Posted April 25, 2017 Author Share Posted April 25, 2017 Having never been exposed to Python it didn't seem like the obvious answer to me. (OLD school here: BasicPlus, APL, Pascal, C++, Vectorscript) None the less I spent 20 minutes searching for how to call up Python within the 2013 version of Vectorscript on Mac and found NIL, nothing and frustration. In the end I wrote another eight lines of code and added three variables into my Plugin to organise the output of the two platforms separately. Sorting the two outputs into a standardized format of YYYY/MM/DD, no dashes, no single digit days or months. But I did appreciate the reply, thanks Josh. Larry Quote Link to comment
JBenghiat Posted April 26, 2017 Share Posted April 26, 2017 Ah, Python was introduced in VW 2014. Sorry I missed your version number. With 2014 forwards, you can create scripts entirely in Python, or run Python commands from within VS. -Josh Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.