Euphoria Ticket #1012: 8.4.4.1 datetime (explanation is unclear)

  • Declares a variable of type datetime.
  • Type checks an existing variable to determine if it is a valid datetime

Example 1:

include std/datetime.e  
  
datetime x = now() -- x is a datetime variable, and now() returns a datetime 
? x  
? datetime(x) -- is it a datetime variable?  

Results:

{2019,9,8,3,23,23}  
1 

Example 2:

include std/datetime.e 
 
object y = {2019,01,10} -- y is not a datetime variable, just a sequence containing a date 
? y 
? datetime(y) -- is this a datetime variable?  

Results:

{2019,1,1} 
0 

Example 3:

include std/datetime.e 
 
datetime z = {2019,01,01} -- z is declared as a datetime type, so it is validated on assignment 
-- what we assigned was not a valid datetime, so we get: 
-- type_check failure, z is {2019,1,1}  

Details

Type: Task Severity: Normal Category: Documentation
Assigned To: euphoric Status: Fixed Reported Release:
Fixed in SVN #: View VCS: none Milestone: 4.1.0

Search



Quick Links

User menu

Not signed in.

Misc Menu