Jump to content
Macro Express Forums

Current year to decimal or integrer variable.. ?

Recommended Posts

I'm not really clear what you mean.


If you have the year as a text variable tYear then you can simply convert it to a decimal variable dYear:

Variable Set String %tYear% to "2016"
Variable Modify String %tYear%: Convert to Decimal (%dYear%)
Text Box Display: Result

Or do you mean you want to convert the current Date (not year), as in this command?

Convert Date/Time to Decimal: %dtCurrentTime% => %dCurrentTime%

Here's an extract from ME Pro's excellent Help:


Convert Date/Time to Decimal Variable


This option converts a Date/Time variable to a decimal value representing the date/time. The value is then saved to a Decimal variable. Create a Date/Time variable through the Variable tab in the Script Editor or through the Date/Time command.


Script Editor > Expand Variables Category > Convert Date/Time to Decimal

Date/Time Variable to Convert

Select the Date/Time variable to convert to a Decimal variable.

Decimal Variable to Receive the Result

Select the Decimal variable to store the value of the converted Date/Time variable.



Below is a sample date and time saved to a Date/Time variable:

4/25/2011 11:00:05 AM


The Date/Time variable value above converts to the decimal value shown below:


The first 5 digits represent the date. The decimal section, to the right of the period, represents the time (or fraction of a day).




Terry, East Grinstead, UK

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...