Intermec PM4i Fingerprint Developer's Guide (old) - Page 134

Setting the Date and Time, Reading the Clock and Calendar

Page 134 highlights

Chapter 7 - Controlling the Printer Setting the Date and Time Some Intermec printers are equipped with a real-time clock (RTC) with battery backup. If an RTC is installed, the internal clock is updated from the RTC at each startup. If no RTC is installed, you need to manually set the clock using either a DATE$ or a TIME$ variable, or an error occurs when trying to read the date or time. If only the date is set, the internal clock starts at 00:00:00, and if only the time is set, the internal clock starts at Jan 01 1980. After setting the internal clock, you can use the DATE$ and TIME$ variables the same way as when an RTC is fitted, until a power off or REBOOT causes the date and time values to be lost. The built-in calendar runs from 1980 through 2048 and corrects illegal values automatically (for example, 081232 is corrected to 090101). In addition to the standard formats (YYMMDD and HHMMSS), other formats for date and time can be specified by these Fingerprint commands: • FORMAT DATE$ • FORMAT TIME$ • NAME DATE$ • NAME WEEKDAY$ Reading the Clock and Calendar These Fingerprint commands are used to read the clock and calendar: • =DATE$ • =DATE$("F") - Returns the current date in the format specified by FORMAT DATE$ to a string variable. • =TIME$ • =TIME$("F") - Returns the current time in the format specified by FORMAT TIME$ to a string variable. • DATEADD$ • TIMEADD$ • DATEDIFF • TIMEDIFF • WEEKDAY • WEEKDAY$ - Returns the name of the weekday of a specified date in plain text according to the weekday names specified by NAME WEEKDAY$, or if such a name is missing, the full name in English. • WEEKNUMBER • TICKS In most cases, you can specify the current date or time using DATE$ or TIME$ respectively, as in this example: 118 Intermec Fingerprint Developer's Guide

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184
  • 185
  • 186
  • 187

Chapter 7 — Controlling the Printer
118
Intermec Fingerprint Developer’s Guide
Setting the Date and Time
Some Intermec printers are equipped with a real-time clock (RTC) with battery
backup. If an RTC is installed, the internal clock is updated from the RTC at each
startup.
If no RTC is installed, you need to manually set the clock using either a DATE$ or a
TIME$ variable, or an error occurs when trying to read the date or time. If only the
date is set, the internal clock starts at 00:00:00, and if only the time is set, the
internal clock starts at Jan 01 1980. After setting the internal clock, you can use the
DATE$ and TIME$ variables the same way as when an RTC is fitted, until a power
off or REBOOT causes the date and time values to be lost.
The built-in calendar runs from 1980 through 2048 and corrects illegal values
automatically (for example, 081232 is corrected to 090101).
In addition to the standard formats (YYMMDD and HHMMSS), other formats for
date and time can be specified by these Fingerprint commands:
FORMAT DATE$
FORMAT TIME$
NAME DATE$
NAME WEEKDAY$
Reading the Clock and Calendar
These Fingerprint commands are used to read the clock and calendar:
<svar>=DATE$
<svar>=DATE$(“F”) - Returns the current date in the format specified by
FORMAT DATE$ to a string variable.
<svar>=TIME$
<svar>=TIME$(“F”) - Returns the current time in the format specified by
FORMAT TIME$ to a string variable.
DATEADD$
TIMEADD$
DATEDIFF
TIMEDIFF
WEEKDAY
WEEKDAY$ - Returns the name of the weekday of a specified date in plain text
according to the weekday names specified by NAME WEEKDAY$, or if such a
name is missing, the full name in English.
WEEKNUMBER
TICKS
In most cases, you can specify the current date or time using DATE$ or TIME$
respectively, as in this example: