1. Computing & Technology

Discuss in my forum

Creating Stardates with PHP

How to change the date into a stardate

By , About.com Guide

Creating Stardates with PHP
After much research online, there seems to be a consensus that there is no sure-fire formula to calculate stardates. There seems to be inconsistency in stardates between the different series, and as it is based on future dates all contemporary dates are negative numbers. One thing we can do is format the current date to appear like a stardate. We can format it as YYMM.DD.
 <?php 

$b = time ();

print date("l, F jS Y",$b) . " as a stardate could be " . date("ym.d",$b);

?>

This will display: Thursday, May 7th 2009 as a stardate could be 0905.07. The part of this that actually creates the stardate is date("ym.d",$b).

If you are interested in other formulas for calculating stardates, visit TrekGuide.com Have you created a calculator you want to share, or a formula? Just have a comment to add? Go to the stardate user response page.

  1. About.com
  2. Computing & Technology
  3. PHP / MySQL
  4. Step By Steps
  5. Create a Stardate with PHP - Star Trek Dates with PHP - Star Date in PHP

©2012 About.com. All rights reserved.

A part of The New York Times Company.