summaryrefslogtreecommitdiff
path: root/vendor/thecodingmachine/safe/generated/calendar.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/thecodingmachine/safe/generated/calendar.php')
-rw-r--r--vendor/thecodingmachine/safe/generated/calendar.php21
1 files changed, 12 insertions, 9 deletions
diff --git a/vendor/thecodingmachine/safe/generated/calendar.php b/vendor/thecodingmachine/safe/generated/calendar.php
index aae699923..a5b03905e 100644
--- a/vendor/thecodingmachine/safe/generated/calendar.php
+++ b/vendor/thecodingmachine/safe/generated/calendar.php
@@ -5,21 +5,24 @@ namespace Safe;
use Safe\Exceptions\CalendarException;
/**
- * This function will return a Unix timestamp corresponding to the
- * Julian Day given in jday or FALSE if
- * jday is outside of the allowed range. The time returned is
- * UTC.
+ * Return the Julian Day for a Unix timestamp
+ * (seconds since 1.1.1970), or for the current day if no
+ * timestamp is given. Either way, the time is regarded
+ * as local time (not UTC).
*
- * @param int $jday A julian day number between 2440588 and 106751993607888
- * on 64bit systems, or between 2440588 and 2465443 on 32bit systems.
- * @return int The unix timestamp for the start (midnight, not noon) of the given Julian day.
+ * @param int $timestamp A unix timestamp to convert.
+ * @return int A julian day number as integer.
* @throws CalendarException
*
*/
-function jdtounix(int $jday): int
+function unixtojd(int $timestamp = null): int
{
error_clear_last();
- $result = \jdtounix($jday);
+ if ($timestamp !== null) {
+ $result = \unixtojd($timestamp);
+ } else {
+ $result = \unixtojd();
+ }
if ($result === false) {
throw CalendarException::createFromPhpError();
}