找回密码
 注册
X系列官方授权正版
搜索
查看: 3946|回复: 3

[分享] 星历与公元年份换算器[星际迷航]

[复制链接]
发表于 2010-7-20 09:23:46 | 显示全部楼层 |阅读模式
http://steve.pugh.net/fleet/stardate.html

The current Stardate is -313549
In the 24th Century it is 'currently' Stardate 64549




These conversion routines convert to and from Star Trek: The Next Generation style Stardates. These stardates take the form YYXXX.XX where the first two digits refer to the year with 2323 being year zero and the remaining digits being the decimal portion of the year. The last digit before the decimal point is one stardate and is approximately eight and three quarters hours in length.


This first conversion is rather crude and actually makes stardates different lengths in leap years and non leap years. It can handle dates from any year. Dates before 2323 are preceedes by a minus sign, however they numbers showing the portion of the year elapsed still flow in a poitive direction (ie: -20999.99 is followed by -19000.00). Years before 2223 or after 2423 have a three digit year number and are therefore of the form YYYXXX.XX
The program assumes you are entering the date and time as the Gregorian calendar and GMT.
Date to Stardate Converter
YearMonthDayHoursMinutes
  
Stardate:



This second function is the reverse of the first and converts stardates to Gregorian dates and GMT time. It is possible to get strange results by putting minus signs or decimal points in the wrong place (eg: 5.6-6790) I may get around to writing some code to catch this, but then again, I may find something better to do with my time. Another odd thing is that JavaScript (or just this script?) can't handle years below 100 CE so any stardate before -2223000.00 will return a wrong answer.
Stardate to Date Converter
Stardate:
Date:



This last function also converts from Gregorian/GMT dates into stardates but assumes a standard year length of 365.2425 days and thus has stardates of equal length regardless of whether the Gregorian year is a leap year or not. Stardates generated by this method will differ by a small amount to those generated by method one. I have yet to write the code to convert back from this "quad-cent calendar" to the Gregorian calendar but as they are rarely more than a few hours different there is little urgency for me to do so at the moment.
Date to Stardate Converter
Method Two: more accurate but only works
for years between 2323 and 2423.
YearMonthDayHoursMinutes
  
Stardate:



March 2004 - A note about the 'current' dates at the top of the page. As present and Trek leap years don't line up (TNG Year 1 was 1987 and 2364) there are sometimes small discrepancies between the 'current' date and the date obtained from the main calculator.
August 2000 - Recently I've fixed a leap year bug (wherein the script made every month in a leap year 29 days long and not just February) and added the routine to display the current stardate. Opera 4 handles the scripts properly which is a big improvement over Opera 3.


For more information on stardates refer to the Stardates in Star Trek FAQ by Andrew Main, which is posted monthly to the rec.arts.startrek.tech newsgroup.


On average I get a request a month asking if I will let this script be used on another web site. My answer is always no. This script is accessible to everyone here, this site isn't going anywhere and hence there is no need for it to reproduced anywhere else. If I ever find that anyone has copied this script then I will take steps, up to and including legal action, to have the copy removed.

Last updated November 26th 2005. © Stephen Pugh. [Home page] [E-mail]
Star Trek™, ® & © by Paramount Pictures. All Rights Reserved.
Star Trek is a registered trademark of and all characters and related marks are trademarks of Paramount Pictures.

发表于 2010-7-20 09:48:01 | 显示全部楼层
完全崩溃,不会用呢
回复

使用道具 举报

发表于 2010-7-20 10:47:15 | 显示全部楼层
-313549.17
回复

使用道具 举报

发表于 2010-7-20 11:58:25 | 显示全部楼层
求翻译
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

Archiver|手机版|小黑屋|DeepTimes.NET 太空游戏站