unixtojd: Unix time stamp to Julian calendar

$tt=time(); // time stamp of today. 
echo "Time Stamp = $tt ";
$day_jd=unixtojd($tt);
echo "Julian Day by using unixtojd() : $day_jd ";
The output is here By using unix time stamp we can generate Julian date calendar or any other calendar.
unixtojd(time_stamp);
Time Stamp = 1760412874
Julian Day by using unixtojd() : 2460962 

Example: Convert Current Unix Timestamp to Julian Day

$timestamp = time();
echo unixtojd($timestamp);  // Output: Julian day for the current Unix timestamp

Example: Convert Specific Date (Unix Timestamp) to Julian Day

$specific_date = mktime(0, 0, 0, 1, 1, 2000);
echo unixtojd($specific_date);  // Output: Julian day for January 1, 2000

Example: Handling Negative Unix Timestamps (Dates Before 1970)

$date_before_1970 = mktime(0, 0, 0, 12, 31, 1965);
echo unixtojd($date_before_1970);  // Output: Julian day for December 31, 1965

Example: Convert Specific Date Using strtotime()

$date_str = strtotime('2022-03-15');
echo unixtojd($date_str);  // Output: Julian day for March 15, 2022

Example: Convert Unix Timestamp for a Future Date

$future_date = mktime(0, 0, 0, 1, 1, 2030);
echo unixtojd($future_date);  // Output: Julian day for January 1, 2030

Example: Convert Unix Timestamp for Epoch (1970-01-01)

$epoch = mktime(0, 0, 0, 1, 1, 1970);
echo unixtojd($epoch);  // Output: Julian day for the Unix Epoch

Julian Day count to Unix timestamp
Calendar Functions

Subhendu Mohapatra — author at plus2net
Subhendu Mohapatra

Author

🎥 Join me live on YouTube

Passionate about coding and teaching, I publish practical tutorials on PHP, Python, JavaScript, SQL, and web development. My goal is to make learning simple, engaging, and project‑oriented with real examples and source code.



Subscribe to our YouTube Channel here



plus2net.com











PHP video Tutorials
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
©2000-2025   plus2net.com   All rights reserved worldwide Privacy Policy Disclaimer