ヴァナ・ディール ☆基地外 たる 時計☆
Vana'diel Crazy Taru Clock
I was bored , so decided to port the Pyogenes "Vana'diel Time" Clock to C#
About:
Vana'diel time is 25 times faster than Earth time and is being used in the fictional? universe of Final Fantasy XI Online
I made a simple API that you can use to get current weather in Vana'diel, that means you can use it in any application you want, everything from Command Line Applications, to AJAX Powered ASP.NET websites, remember, you have to use Timer.Tick() to update the information from the API! Or you can implement it directly to the class, if you want to; do whatever you want with it, just remember to credit me and Pyogenes for his great formula.
Note this is the first implementation of Vana'diel clock in C# , if I'm wrong , someone correct me...
Here goes the code (Sorry, no comments (yet), I'm sleepy):
using System;
using System.Collections.Generic;
using System.Text;
{
public static class Time
{
private static DateTime basisDate = new DateTime(2002, 06, 23, 15, 00, 00, 0000);
private static long msRealDay = 86400000;
private static string[] VanaDay = { "Firesday", "Earthsday", "Watersday", "Windsday", "Iceday", "Lightningday", "Lightsday", "Darksday" };
private static double vanaDate
{
get { return ((898 * 360 + 30) * msRealDay) + ((DateTime.UtcNow - basisDate).TotalMilliseconds * 25); }
}
public static double vYear
{
get { return Math.Floor(vanaDate / (360 * msRealDay)); }
}
public static double vMon
{
get { return Math.Floor((vanaDate % (360 * msRealDay)) / (30 * msRealDay)) + 1; }
}
public static double vDate
{
get { return Math.Floor((vanaDate % (30 * msRealDay)) / (msRealDay)) + 1; }
}
public static double vHour
{
get { return Math.Floor((vanaDate % (msRealDay)) / (60 * 60 * 1000)); }
}
public static double vMin
{
get { return Math.Floor((vanaDate % (60 * 60 * 1000)) / (60 * 1000)); }
}
public static double vSec
{
get { return Math.Floor((vanaDate % (60 * 1000)) / 1000); }
}
public static double vDay
{
get { return Math.Floor((vanaDate % (8 * msRealDay)) / (msRealDay)); }
}
public static string TextTime = vMon + "/" + vDate + "/" + vYear + " (" + VanaDay[Convert.ToInt16(vDay)] + ") " + vHour + ":" + vMin + ":" + vSec;
}
}
In your application's main void or click event or whatever write the following code:
MessageBox.Show(Animaonline.Vanadiel.Time.vHour + ":" + Animaonline.Vanadiel.Time.vMin + ":" + Animaonline.Vanadiel.Time.vSec);
That's it, enjoy! :D
Back to Home
