summaryrefslogtreecommitdiff
path: root/vendor/thecodingmachine/safe/generated/calendar.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2022-07-12 22:26:21 +0300
committerAndrew Dolgov <[email protected]>2022-07-12 22:26:21 +0300
commit80d3db1dcf8fe9ca66d4e3f2e2116d3bc39ae2b4 (patch)
tree04b33bfb9c9368c4a31e287153abec690b9014e0 /vendor/thecodingmachine/safe/generated/calendar.php
parent4b6161892000cb2b8392dce92a9cf2cabdf2d20e (diff)
upgrade idiorm to php8.1-patched version (aaronpk/idiorm)
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();
}