[Plugin] System date and time

Post your completed addons to share with the community

Post » Fri Jan 23, 2015 3:10 am

Thanks, Rexrainbow!
Image Image
B
35
S
16
G
7
Posts: 143
Reputation: 6,253

Post » Wed Jan 28, 2015 9:12 pm

I might be too new at this, but I'm having a hard time understanding how to use the plugin. The mechanics are there but I'm just not getting it.

I made a very simple "digital pet" app and I wanted your plugin to check the time since the user last logged in. I need to use this data in order to assign the "pets" age variable. Do you have a simple example of how I could do this?

Thank you.
B
10
S
4
G
2
Posts: 125
Reputation: 1,678

Post » Thu Jan 29, 2015 4:53 am

@TheSynan

Try rex_time_away plugin.
Call "Action:Start timer" when left. You might need to call it every tick (or every second/minute) to prevent left game without logging out.
Then get the elapsed time by "Expression:ElapsedTime" at next login.
B
97
S
22
G
176
Posts: 4,108
Reputation: 103,019

Post » Thu Jan 29, 2015 7:10 am

rexrainbow wrote:@TheSynan

Try rex_time_away plugin.
Call "Action:Start timer" when left. You might need to call it every tick (or every second/minute) to prevent left game without logging out.
Then get the elapsed time by "Expression:ElapsedTime" at next login.


So, start the timer on end of layout?
At start of layout get elapsedtime?

:/ Maybe I should read up some more haha.
B
10
S
4
G
2
Posts: 125
Reputation: 1,678

Post » Thu Jan 29, 2015 8:00 am

@TheSynan

Yes, you might try the sample capx appended in document.
B
97
S
22
G
176
Posts: 4,108
Reputation: 103,019

Post » Sat Feb 07, 2015 5:56 am

This is just beautiful! Thank you very much @rexrainbow.

Now I can make a neat addition to my desktop app.
B
28
S
8
G
4
Posts: 767
Reputation: 5,940

Post » Sat Feb 28, 2015 5:02 pm

Hi

When I try to get the todays date using Rex's Date Time plugin I do not get the correct date!?

E.g. today it is the 28. feb. 2015 (Windows clock report "28-02-2015" in lower right corner in my Task bar) , but 'Day-Month-Year' is returned like this '6-2-2105' !?

This is my code:

RexDate.Day & "-" & RexDate.Month & "-" & RexDate.Year

and it return 6-2-1015

What is going on here?! Does the plugin really not calculate the date correct (at least not here in Denmark (Europe)?
Kind Regards,
Mikael Thomsen
www.solunasoftware.com
B
26
S
12
G
1
Posts: 16
Reputation: 2,553

Post » Sun Mar 01, 2015 11:53 am

Problem solved!

I changed my code to:

RexDate.Date & "-" & RexDate.Month & "-" & RexDate.Year

and now it works.

Day is returning day number (0...6)
Date is returning day of month (1..31)

:-)
Kind Regards,
Mikael Thomsen
www.solunasoftware.com
B
26
S
12
G
1
Posts: 16
Reputation: 2,553

Post » Wed Apr 01, 2015 3:00 pm

@rexrainbow

hi, like your plugin but i have small problem.
I would like to use it to determine wich loaded object is newest/oldest by complete date... year, month, day, min, sec, mili...
but i have problem becouse i miss zero prefix in one digit months, days etc or double zeros in mili count.

any tips how to sort this?

thanx!!!
B
26
S
11
G
2
Posts: 669
Reputation: 5,038

Post » Wed Apr 01, 2015 3:11 pm

@irina

Compare timestamp by Expression:UnixTimestamp. Older would have small timestamp.
B
97
S
22
G
176
Posts: 4,108
Reputation: 103,019

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 2 guests