Author Topic: Date and Time  (Read 1297 times)

0 Members and 1 Guest are viewing this topic.

Offline hreintke

Date and Time
« on: August 05, 2012, 03:26:01 PM »
LS,

I am looking for a way to get the date and time of the simulation.
I already have month and year (welt->get_current_month() % 12 + 1, welt->get_current_month() / 12)

But how to get to days, hours, minutes and seconds ? Expect something with ticks ?

Kind regards,

Herman


Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4277
  • Total likes: 195
  • Helpful: 149
  • Languages: EN, DE, AT
Re: Date and Time
« Reply #1 on: August 05, 2012, 03:45:20 PM »
Simutrans does not know other time units than years, months, and ticks. One month = ticks_per_world_month ticks.
Parsley, sage, rosemary, and maggikraut.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4900
  • Total likes: 217
  • Helpful: 108
  • Languages: EN, NO
Re: Date and Time
« Reply #2 on: August 05, 2012, 03:58:49 PM »
Actually, Simutrans does know something about days, hours and minutes. It is displayed in the lower left corner depending on the show_month setting. I think it's just a visual thing, and whether a month has days or hours at all depends on the setting.