EasyManua.ls Logo

Canon Camera - Page 115

Canon Camera
257 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
106 CHAPTER 5 Scripting
%a Abbreviated weekday name (e.g., Thu)
%A Full weekday name (e.g., Thursday)
%b Abbreviated month name (e.g., Sep)
%B Full month name (e.g., September)
%c Date and time (e.g., 09/24/09 23:57:10)
%d Day of the month (e.g., 24)
%H Hour, 24-hour clock (e.g., 23)
%I Hour, 12-hour clock (e.g., 11)
%M Minute (e.g., 57)
%m Month (01 = January, e.g., 09)
%p Either “am or “pm” (e.g., pm)
%S Second (e.g., 10)
%w Weekday (0 = Sunday, e.g., 4)
%x Date (e.g., 09/24/09)
%X Time (e.g., 23:57:10)
%Y Full year (e.g., 2009)
%y Two-digit year (e.g., 09)
%% The character ‘%’ when used as a literal
For example:
s = os.date("today, %B %d, %Y")
returns
"today, September 24, 2009"
A special case is the format string ‘*t’. In this case, the date() function
returns date and time in the form of a table, as seen in the discussion of the
time() function.
In addition to the above functions, the CHDK implementation provides
some more functions that are not part of the standard Lua OS library
(which implements only those OS functions that are part of ANSI C). Con-
sequently, scripts utilizing those functions cannot be tested on another
platform such as a PC, except with an appropriate OS extension library
(section 5.8).

Table of Contents

Related product manuals