forked from livecode/livecode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdate.lcb
More file actions
109 lines (82 loc) · 2.57 KB
/
date.lcb
File metadata and controls
109 lines (82 loc) · 2.57 KB
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
/*
Copyright (C) 2015 LiveCode Ltd.
This file is part of LiveCode.
LiveCode is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License v3 as published by the Free
Software Foundation.
LiveCode is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
/**
This library provides low-level system functionality for modular
LiveCode programs.
*/
module com.livecode.date
use com.livecode.foreign
public foreign handler MCDateExecGetLocalDate(out rDateTime as List) returns nothing binds to "<builtin>"
public foreign handler MCDateExecGetUniversalDate(out rDateTime as List) returns nothing binds to "<builtin>"
public foreign handler MCDateExecGetUniversalTime(out rSeconds as CDouble) returns nothing binds to "<builtin>"
/**
Summary: The local Gregorian date
Example:
variable tDateTime as List
put the local date into tDateTime
variable tDayOfMonth as Number
put tDateTime[3] into tDayOfMonth
Description:
Returns the local date as a list of seven numeric components. The
elements of the list are:
* The year
* The month (1-12)
* The day of the month (1-31, depending on the month)
* The hour (0-23)
* The minute (0-59)
* The second (0-59)
* The offset from UTC in seconds
References: UniversalDate (expression)
Tags: Date and time
*/
syntax LocalDate is expression
"the" "local" "date"
begin
MCDateExecGetLocalDate(output)
end syntax
/**
Summary: The UTC Gregorian date
Example:
variable tDateTime as List
put the universal date into tDateTime
variable tMinuteOfHour as Number
put tDateTime[5] into tMinuteOfHour
Description:
Returns the universal date (i.e. the current date in the UTC+00:00
time zone) as a list of seven numeric components. The elements of the
list are the same as for <LocalDate>.
References: LocalDate (expression)
Tags: Date and time
*/
syntax UniversalDate is expression
"the" "universal" "date"
begin
MCDateExecGetUniversalDate(output)
end syntax
/**
Summary: The seconds
Example:
variable tTime as real
put the universal time into tTime
Description:
Returns the current universal time relative to the start of the UNIX epoch - 1st
January 1970 in seconds.
Tags: Date and time
*/
syntax UniversalTime is expression
"the" "universal" "time"
begin
MCDateExecGetUniversalTime(output)
end syntax
--
end module