• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • Data Sources
    • CSPro Statements and Functions
      • Statement Format Symbols
      • Alphabetical List of Functions and Statements
      • List of Reserved Words
      • Deprecated Features
      • Declaration Statements
      • Symbol Functions
      • Item Functions
      • Array Object
      • Audio Object
      • Barcode and QR Codes
      • Case Object
      • Document Object
      • File Object
      • Freq Object
      • Geometry Object
      • HashMap Object
      • Image Object
      • List Object
      • Map Object
      • Path
      • Pff Object
      • SystemApp Object
      • ValueSet Object
      • Program Control Statements
      • Assignment Statements
      • Data Entry Statements and Functions
      • Batch Edit Statements
      • Numeric Functions
      • String Functions
      • Multiple Occurrence Functions
      • General Functions
      • Date and Time Functions
        • AdjLBA Function
        • AdjLBI Function
        • AdjUBA Function
        • AdjUBI Function
        • DateAdd Function
        • DateDiff Function
        • DateValid Function
        • PublishDate Function
        • SetLB Function
        • SetUB Function
        • SysDate Function
        • SysTime Function
        • timestamp Function
        • timestring Function
      • External File Functions
      • Synchronization Functions
    • Templated Reporting System
    • HTML and JavaScript Integration
    • Action Invoker
    • Appendix
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataViewer>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

PublishDate Function

Format
i = publishdate();
Description
The publishdate function returns the date and time that the code was compiled. Generally, this is not particularly meaningful because the code is compiled right before it is executed. The exception to this is when you create compiled binary data entry applications. These files, with the extension .pen, are used to run applications on mobile devices. In the case of a .pen file, the value returned by the function will be the date and time that the .pen file was created.
Return Value
The function returns a number in the form YYYYMMddHHmmss , where YYYY is the year, MM is the month, dd is the day, HH is the hour, mm is the minute, and ss are the seconds.
Example
numeric publishDay = int(publishdate() / 1000000); // ignore the time

if datediff(publishDay,sysdate("YYYYMMDD")) > 20 then
   
errmsg("This program expires after 20 days. Sync to get a new program.");
   
stop(1);
endif;
See also: DateAdd Function, DateDiff Function, SysDate Function, SysTime Function