[ 🗓️ ] Getting the Real Date Using the Player ID

If you’ve seen this topic:

You most likely know that part of the player ID contains a timestamp.

The player ID is a hexadecimal string of characters that identifies the player. In this guide, I’ll be showing how to use blockcode to convert a hexadecimal string to a decimal number, and also how to use this decimal number to come up with a date. This date can be used to have seasonal events without you having to change your game (and change it back) every time an important date occurs.

How to Make


Materials

You'll need
  • 4390 memory
  • 8 properties
  • 9 triggers
  • A good knowledge and comfortability with blockcode

Properties

Properties

I’ll be listing each property, the name that I made for the property and the type. Scope has to be set to global. (the property names will not make sense, so please change the names. Just make sure to update the names in the blockcode too)

Property 1

  • Name: index
  • Type: Number

NOT REQUIRED (HERE FOR REFERENCE)

  • Name: id
  • Type: Text

Property 3

  • Name: date (This property’s name does not relate to its function)
  • Type: Number

Property 4

  • Name: leapyear?
  • Type: Number

Property 5

  • Name: day of year
  • Type: Number

Property 6

  • Name: Month
  • Type: Text

Property 7

  • Name: Year
  • Type: Text

Property 8

  • Name: Day
  • Type: Number
Triggers

Triggers

I’ll be listing each trigger, the channel that triggers them and the blockcode.

NOT REQUIRED
I updated the guide to use less memory. This is still here for reference.

Trigger 2
Trigger loop of the channel “Step 2”
Maximum of 8 triggers

Trigger 3
Triggered on “Step 3”

Trigger 4
Triggered on “Step 4”

Trigger 5
Triggered on “Step 4b”

Trigger 6
Triggered on “Step 5”

Trigger 7
Triggered on “Step 5b”

Trigger 8
Triggered on “Step 5c”

Trigger 9
Triggered on “Step 6”

Result (kinda)



This has not been completely tested and is usually off ± 1 day. But here’s a working date finder using the player ID :slight_smile: . If you have questions or something isn’t working, please post a reply and tell me.

This took a very long time to design and create, so please leave a :heart:. It would be very appreciated.

18 Likes

Funny thing is i was working on a version of this too it was just for a different thingy

2 Likes

“What’s up guys? Today, I’m going to make a graphing calculator WORKING CALENDAR in GIMKIT”

6 Likes

Mm, yes, though its not fully accurate, we can basically have time zones in gimkit now ;-;

starts freaking out

4 Likes

If the date is usually off by 1 day then add one to the property at the end of the whole process

Well in the picture it’s showing -1 day so I’m assuming that’s always the case

1 Like

But what if it’s 1 ahead, then adding 1 makes it 2 days ahead?

1 Like

Using this code and creating properties for 0 = 0, 1 = 1…a = 10…etc, we can easily get the time in seconds from January 1st 1970, in case you wanted less memory for this guide.

Mine only goes through how to get the seconds, I love that you’re expanding on it (even though I posted mine 2 hours later than yours)

1 Like

They used the plus or minus sign, meaning it’s either one ahead or one behind.

1 Like

It’s actually most likely a timezone problem and accuracy varies based off of where you are.

I just updated the guide to use the same memory as your’s did because I realized I just had enough blocks to do so.

1 Like

hmm well can we get time zones from game codes? I wonder if that’s possible…

Nope, all times are in UTC time zone.

1 Like

I’m a little curious but is there anyway you can convert it to for example EST or any other time zone?

Just add or subtract how many hours you are away from utc/gmt

Don’t forget daylight savings time though

Example: if Qatar is GMT+2, then get the time t and add 2 hours

Yes, and @Boss_1s pretty much answered that, but if your players had to select which timezone they were in, that would defeat the entire purpose of finding the time automatically.

1 Like