• About Me
  • Blog
  • Tutorials
    • ffmpeg

C#: Convert the current time to FFXIV’s Eorzea Time

14 January 2015C#, Development2 commentsoli

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:

C#
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:

C#
1
var eorzeaTimeNow = DateTime.Now.ToEorzeaTime();

or for a specific date and time:

C#
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! :)

Tags: DateTime, Eorzea, Eorzea Time, FFXIV, Final Fantasy, XIV

2 comments. Leave new

Jeremy
26 April 2015 7:50 pm

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.

Reply
Johnny
6 June 2015 7:10 am

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! 

Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • WPF: Drag Parent Window Behaviour 29 April 2015
  • C#: Convert the current time to FFXIV’s Eorzea Time 14 January 2015
  • C# async-await: Common Deadlock Scenario 12 January 2015
  • MVVMLight SimpleIoC: Design-time Error 12 January 2015
  • A New Beginning 16 February 2014

Categories

  • C#
  • Development
  • Digital Media
  • ffmpeg
  • Gaming
  • Personal
  • Photography
  • Sound Design
  • Tutorial
  • WPF

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

Welcome

Hi, I'm Oli Trenouth, and I’m deeply passionate about both software development, and all things audio and video. I’m an established software developer, audio engineer and video editor with over 17 years experience.

This website aims to showcase my work, my thoughts and tutorials. Thank you for visiting :)

Recent Posts

  • WPF: Drag Parent Window Behaviour 29 April 2015
  • C#: Convert the current time to FFXIV’s Eorzea Time 14 January 2015
  • C# async-await: Common Deadlock Scenario 12 January 2015
Copyright © 2015 - Oliver Trenouth

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.