Ph: 800-848-2576
Fax: 360-654-8170
Contact Us
Date Conversion Logic and Syntax
Date Conversion routines are thoroughly described under the Special Operators section of the Visimage for Windows Reference Manual. Following are a few examples which are used most frequently.

Note: To implement date conversions for end users, we recommend designing a MACRO FILE which will incorporate many of the date conversions users will need on a regular basis. See MACRO Samples for pre-defined macro files that may be appropriate for your environment. If you want to add a macro file to a user's VISIMAGE setup, see Adding a MACROFILE.
Converting a date currently stored in YYMMDD format to a MMDDYY format:
!datext:x6(!datint (your-ymd-date, "ymd" ), "mdy")

Converting a date currently stored in YYMMDD format to a CCYYMMDD format:
!datext:x8(!datint (your-ymd-date, "ymd" ), "cymd")

Converting a date currently stored in CCYYMMDD format to a MMDDYY format:
!datext:x6(!datint (your-cymd-date, "cymd"), "mdy")

Expressing TODAY's date in a YYMMDD format:
!datext:x6($seconds, "ymd")

Expressing YESTERDAY's date in a YYMMDD format:
!datext:x6(($seconds - 86400) , "ymd")

Calculating the DIFFERENCE in DAYS between two different ymd-dates in your database:
!cvt:p20(!datint(your first-ymd-date,"ymd") / 86400)
 -!cvt:p20(!datint(your-second-ymd-date ,"ymd") / 86400)

Calculating the DIFFERENCE in DAYS between TODAY'S DATE and a ymd-date in your database:
!cvt:p20(($seconds - !datint(your -ymd-date,"ymd")) / 86400)
Send questions & comments regarding the Vital Soft site to:  webmaster@vital-soft.com
Copyright © 1998-2012, Vital Soft, Inc.