24/7 Support: 800.608.6482

Get Started

Developer Docs

Time Functions

Example Code

Most of these functions must be called with two arguments, here designated time_t and time_zone. time_t is the number of seconds since the beginning of C.U.T. (Coordinated Universal Time) at 00:00:00 January 1, 1970. This value can be obtained from the system variables time_t and dyn_time_t (time_t is set when the script starts executing; dyn_time_t is updated at the moment that it is used; which one you use depends on what your program does).

time_zone is the number of hours before or after GMT; this value can be obtained using the built-in function timezone(). Here is an example of how a time function can be called:

Note: These functions cannot be used to process dates earlier than January 1, 1970, or later than January 19, 2038.

mktime_t

Returns the s.time_t value for the time specified. time_zone can be the keyword 'local'

timezone

Returns an integer which is the number of hours behind or ahead of GMT (not accounting for Daylight Time)

time_t_dayofmonth

Returns the current month as a number. time_zone can be the keyword 'local'

time_t_dayofweek

Returns the current day of the week as a number (Sunday=1). time_zone can be the keyword 'local'

time_t_dayofyear

Returns the number of days since the beginning of the year, including today. time_zone can be the keyword 'local'

time_t_hour

Returns current hour (using a 24-hour clock). time_zone can be the keyword 'local'

time_t_min

Returns the current minute in the hour. time_zone can be the keyword 'local'

time_t_month

Returns the current month as a number. time_zone can be the keyword 'local'

time_t_sec

Returns the current second in the minute. time_zone can be the keyword 'local'

time_t_year

Returns the current year, time_zone can be the keyword 'local'

Miva believes that all online businesses should have access to a scalable ecommerce platform that can meet their unique business requirements. Miva offers PCI compliant ecommerce, hosting, and custom website design and development solutions. Miva customers have processed over $100 billion in online sales since 1997.

Copyright © 2016 Miva, Inc - All Rights Reserved   Privacy Policy | Store Policy

Links
Contact Us
Receive Tips & Updates

Copyright © 2017 Miva, Inc - All Rights Reserved

Back To The Top