!!! tip "Attention" Start date in Calc and Python are different.
### **today** Get current date. ```py d = app.dates app.msgbox(d.today) ```
### **now** Get current date and time. ```py d = app.dates app.msgbox(d.now) ```
### **time** Get current time. ```py d = app.dates app.msgbox(d.now.time()) ```
### **epoch** Get [Unix time][1] ```py d = app.dates app.msgbox(d.epoch) ```
### **date** Get a date. ```py d = app.dates date = d.date(1974, 1, 15) app.msgbox(date) ```
### **time** Get a time. ```py d = app.dates time = d.time(10, 20, 15) app.msgbox(time) ```
### **datetime** Get date and time. ```py d = app.dates dt = d.datetime(1974, 1, 15, 10, 11, 12) app.msgbox(dt) ```
### **str_to_date** String to date. Look this [excellent info][2] ```py d = app.dates str_date = '1974-01-15' template = '%Y-%m-%d' obj_date = d.str_to_date(str_date, template) app.msgbox(obj_date) app.msgbox(type(obj_date)) ``` Get a valid date for insert in a Calc cell. ```py d = app.dates str_date = '1974-01-15' template = '%Y-%m-%d' obj_date = d.str_to_date(str_date, template, True) app.msgbox(obj_date) app.msgbox(type(obj_date)) ```
### **calc_to_date** Converts a value to Python date, for example, the initial date set in Calc. ```py d = app.dates value = 0 obj_date = d.calc_to_date(value) app.msgbox(obj_date) app.msgbox(type(obj_date)) ```
### **sleep** Pause execution for X seconds. !!! tip inline end "Attention" The pause is blocking. ```py d = app.dates app.sleep(3) app.msgbox('End') ```
### **start** and **end** Measure time in seconds. ```py d = app.dates d.start() app.sleep(5) seconds = d.end() app.msgbox(seconds) ``` Get timedelta instead of seconds ```py d = app.dates d.start() app.sleep(5) td = d.end(False) app.msgbox(td) ``` [1]: https://en.wikipedia.org/wiki/Unix_time [2]: https://strftime.org