1. Home
  2. Computing & Technology
  3. PHP / MySQL

Creating Stardates with PHP
How to change the date into a stardate

By Angela Bradley, About.com

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.

More PHP / MySQL Quick Tips
Explore PHP / MySQL
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  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

©2009 About.com, a part of The New York Times Company.

All rights reserved.