is there a way to get a timestamp and store it in a variable?

joseanjim

Villager
Member
Joined
Sep 15, 2015
Messages
11
Reaction score
1
First Language
spanish
Primarily Uses
It could be needed to record a log of some messages from an idler game I'm thinking about...
As the game would play itself alone I should achieve to create a log.txt archive and write lines to it with a format of: TIMESTAMP "game message"
 
Last edited:

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
2,948
Reaction score
1,054
First Language
Dutch
Primarily Uses
RMMV
which timestamp are you talking about? I know only a real timestap which has the date + time
from users pc, if you talk about other timestamp, than i dont know. but if you have multiple
and different message logs with different time, you need multiple variables as well.

the RL time I use currently keep counting up as well, but I dont know how to fix it
but there is a way if not used in parallel process which you can try out.

but can you explain a bit which timestamp?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,434
Reaction score
7,713
First Language
German
Primarily Uses
RMMV
control variable can pull "play time" from game data, that is the time that has elapsed since the game was started with "new game"
 

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
954
Reaction score
520
First Language
Javascript
Primarily Uses
RMMZ
It could be needed to record a log of some messages from an idler game I'm thinking about...
As the game would play itself alone I should achieve to create a log.txt archive and write lines to it with a format of: TIMESTAMP "game message"
...If you want real time (according to the machine being used):
To get Date:
Code:
new Date().toDateString()
To get Time:
Code:
function getTime(){var d = new Date(); var h = d.getHours(), m = d.getMinutes(); var suffix = h >= 12 ? "PM":"AM"; h = ((h + 11) % 12 + 1); return h + ':' + m + ' ' + suffix;}; getTime()
1589642419398.png
1589642660959.png



...if you mean playtime like Andar mentioned above..
pull "play time" from game data, that is the time that has elapsed since the game was started with "new game"
Screenshot:
1589645415192.png
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,051
Messages
1,018,549
Members
137,837
Latest member
Dabi
Top