Jump to content

Suggestion: KSP date format


Brainlord Mesomorph

Recommended Posts

Been working in excel, (and access) and I needed a usable KSP date that could be sorted by the computer. So I did this:

y001d102 (year 1 day 102)

y005d008 (year 5 day 8)

y098d012 (year 98 day 12)

as long as you make each part a 3 digit number (use leading zeros) it works.

Just thought I'd share.

EDIT: fixed the year part,

Edited by Brainlord Mesomorph
Link to comment
Share on other sites

But then what about when you go past 3 digits? Does everything break?

You're playing KSP for 1000 years?! (Interstellar mod?)

True, it only works for the 1st Millennium.

EDIT: you COULD use a 4 digit year. Then it fails in 10,000 years!

Edited by Brainlord Mesomorph
Link to comment
Share on other sites

Use the KSP UT (i.e. seconds after epoch). It's there in game, and in the save files, and it's universal across all games independent of the time display settings.

If you want/need a usable date displayed in your forms, use a format converter to get in into Kerbin or Earth time.

Seriously, in almost all cases this will make your life easier.

Link to comment
Share on other sites

Use the KSP UT (i.e. seconds after epoch). It's there in game, and in the save files, and it's universal across all games independent of the time display settings.

If you want/need a usable date displayed in your forms, use a format converter to get in into Kerbin or Earth time.

Seriously, in almost all cases this will make your life easier.

Seconds??!!

My god, how long a number is that?

Undoubtedly true to the game engine. A format converter could be written. Not a bad idea.

But I was just looking for a simple date. A way to organize my departure schedule. I really don't think I'll be able to wrap my head around the difference between 10 billion and 12 trillion seconds.

Maybe in my next build.

Thanks

Link to comment
Share on other sites

I always thought if ksp was coded like that( y001d102h04m45s56) instead of the KSP UT(limited by 32-bit interger) then it count higher, since the ticker can just roll over more and more. OP's suggestion woul last till year 999, whereas current system tops out at year 234 or something.

Link to comment
Share on other sites

Seconds??!!

My god, how long a number is that?

y001d001 is eight signs already; that would allow for a lot of seconds.

Seconds since epoch is great for anything that needs to be calculated with. For naming save games, I much prefer the y1d032 aproach, with single-digit years. Old savegames get moved/erased anyway.

Link to comment
Share on other sites

Why invent the wheel again ? Just do it similar of how computers do it:

At the starting date/time it's 0, and every "unit" adds 1 to it. So if days are the lowest you want to know, Y1D2 would be 1, Y2D10 would be 861.

You can then not only sort it correct (as long as its stored as number and not as string), plus you can do maths with it too like adding, substracting and so on. And it wouldn't limit you at any time (beside the natural limit of variable types)

Edited by thyriel
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...