I was intrigued by a post on Stack Overflow today where a developer was asking how to convert the current time to Eorzea Time, a fictional timebase used in Final Fantasy XIV’s persistent game world.
I’ve never played FFXIV – and probably never will, but I was intrigued by the problem:
Eorzea time runs faster than real-time. 60 minutes in Eorzea equates to only 2m 55s on Earth. Calculating Eorzea time therefore seemed a simple case of multiplying the current DateTime by some constant.
The first hurdle I spotted was that I needed to define what I mean by ‘multiply the current date/time’. Do I multiply time since the year 0001? Or do I use epoch time (the time elapsed since 1/1/1970). After some experimentation, I realised that Eorzea time must be based on epoch time.
The Eorzea multipler constant was easy to calculate based on this infomation: 1Bell = 60 minutes = 3600 seconds. On Earth, the equivalent is 2 minutes 55 seconds = 175 seconds. So the multiplier is simply ( 3600 / 175 ).
Here’s the code I ended up writing, which I encapsulated into a DateTime extension method:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
public static class EorzeaDateTimeExtention { public static DateTime ToEorzeaTime(this DateTime date) { const double EORZEA_MULTIPLIER = 3600D/175D; // Calculate how many ticks have elapsed since 1/1/1970 long epochTicks = date.ToUniversalTime().Ticks - (new DateTime(1970, 1, 1).Ticks); // Multiply those ticks by the Eorzea multipler (approx 20.5x) long eorzeaTicks = (long)Math.Round(epochTicks * EORZEA_MULTIPLIER); return new DateTime(eorzeaTicks); } } |
With this in place, you can calculate the current Eorzea time by simply calling:
1 |
var eorzeaTimeNow = DateTime.Now.ToEorzeaTime(); |
or for a specific date and time:
1 |
var eorzeaSpecificTime = new DateTime(2014,5,12,5,0,0).ToEorzeaTime(); |
And that’s that. This code is of no use to me, but hopefully you will find is useful! :)
2 comments. Leave new
This is interesting.I am just now picking up programming of the sorts, and was considering making a clock of Eorzea time as one of my first projects. I wasn’t sure where to start since I am but a noob in the science, but this as a functional base will be useful so I can see as I put stuff together how my thoughts differ(or are similar) against your coding here.Thank you for your efforts.
Very cool. I’m building an app that will give me a desktop notification when certain items in game become available.. figuring out what the current time in eorzea is was the first hurdle for this problem so thanks a lot for the example!