WINAMP.COM | Forums : Powered by vBulletin version 2.3.9 WINAMP.COM | Forums > Developer Center > NSIS Discussion > Time plugin
  Last Thread   Next Thread
Author
Thread Post New Thread    Post A Reply
Instructor
Major Dude

Registered: Jul 2004
From:

Time plugin

Features:
- Get local time
- Set local time
- Get file/directory creation, last write, last access times
- Set file/directory creation, last write, last access times

Notes:
- All times in "dd.MM.yyyy hh:mm:ss" format (e.g. "01.01.2006 23:59:59")
- Win95/Win98/WinMe: Time set for directory is not supported

!! If you know assembler you can help to implement time set for directory in Win95/Win98/WinMe: link


"Time" plugin v1.0

Attachment: time.zip
This has been downloaded 977 time(s).

__________________
my functions

Quick Link | Report this post to a moderator | IP: Logged

Instructor is offline Old Post 10-05-2005 06:47 AM
Click Here to See the Profile for Instructor Click here to Send Instructor a Private Message Click Here to Email Instructor Visit Instructor's homepage! Find more posts by Instructor Add Instructor to your buddy list Edit/Delete Message Reply w/Quote
Yathosho
Forum King

Registered: Jan 2002
From: AT-DE

nice one

__________________
Fossil 2002 III | VISBOT TV | NSIS Icons | PimpBot | Old Winamp Forums look?

Quick Link | Report this post to a moderator | IP: Logged

Yathosho is offline Old Post 10-05-2005 04:48 PM
Click Here to See the Profile for Yathosho Click here to Send Yathosho a Private Message Visit Yathosho's homepage! Find more posts by Yathosho Add Yathosho to your buddy list Edit/Delete Message Reply w/Quote
Instructor
Major Dude

Registered: Jul 2004
From:

Changes:
-New: "CompareTime" compares two times


"Time" plugin v1.1

Attachment: time.zip
This has been downloaded 792 time(s).

__________________
my functions

Quick Link | Report this post to a moderator | IP: Logged

Instructor is offline Old Post 10-27-2005 06:45 PM
Click Here to See the Profile for Instructor Click here to Send Instructor a Private Message Click Here to Email Instructor Visit Instructor's homepage! Find more posts by Instructor Add Instructor to your buddy list Edit/Delete Message Reply w/Quote
Instructor
Major Dude

Registered: Jul 2004
From:

Fixed: "SetLocalTime" daylight saving time problem
Changed: "CompareTime" replaced with "MathTime"
Added: UTC support ("GetLocalTimeUTC", "SetLocalTimeUTC", "GetFileTimeUTC",
           "SetFileTimeUTC")
New: "MathTime" -mathematical operations with times.
           -calculate day of the week,
           -calculate date after 60 days,
           -calculate how many days between dates,
           -compare dates,
           -calculate how many days in 1234567890 seconds ...
New: "TimeString" -get times from time string


"Time" plugin v1.2

Attachment: time.zip
This has been downloaded 704 time(s).

__________________
my functions

Last edited by Instructor on 12-29-2005 at 09:17 PM

Quick Link | Report this post to a moderator | IP: Logged

Instructor is offline Old Post 12-29-2005 09:01 PM
Click Here to See the Profile for Instructor Click here to Send Instructor a Private Message Click Here to Email Instructor Visit Instructor's homepage! Find more posts by Instructor Add Instructor to your buddy list Edit/Delete Message Reply w/Quote
Instructor
Major Dude

Registered: Jul 2004
From:

Fixed: "MathTime" inaccuracy of day/month->date conversion in one day/month


"Time" plugin v1.3

Attachment: time.zip
This has been downloaded 779 time(s).

__________________
my functions

Quick Link | Report this post to a moderator | IP: Logged

Instructor is offline Old Post 12-30-2005 12:06 PM
Click Here to See the Profile for Instructor Click here to Send Instructor a Private Message Click Here to Email Instructor Visit Instructor's homepage! Find more posts by Instructor Add Instructor to your buddy list Edit/Delete Message Reply w/Quote
Comperio
Major Dude

Registered: Jan 2005
From: Oregon Coast

Not sure if it would work for this plugin or not, but here's a few suggestions that would be nice to have:

1. GetWeekdayName - a function to allow the user to input a time and get back the weekday name (ie "Sunday")

2. GetWeekdayNumber - same as above, but return the weekday number. (ie Sunday=1, Monday=2, etc.)

3. GetMondayDate - input a date and have the system return the Monday from that week. For example, if you input 1/4/2005 (a Wednesday), you would get an output of 1/2/2005 (a Monday).

Quick Link | Report this post to a moderator | IP: Logged

Comperio is offline Old Post 01-04-2006 07:23 PM
Click Here to See the Profile for Comperio Click here to Send Comperio a Private Message Find more posts by Comperio Add Comperio to your buddy list Edit/Delete Message Reply w/Quote
Instructor
Major Dude

Registered: Jul 2004
From:

code:
Name "Output" OutFile "Output.exe" Section #GetWeekdayNumber: time::MathTime "day(29.12.2005 0:0:0) + 5 % 7 =" .r0 MessageBox MB_OK 'GetWeekdayNumber$\n$$0={$0}' #GetWeekdayName: time::MathTime "day(29.12.2005 0:0:0) + 5 % 7 =" .r0 StrCmp $0 1 0 +2 StrCpy $0 Monday StrCmp $0 2 0 +2 StrCpy $0 Tuesday StrCmp $0 3 0 +2 StrCpy $0 Wednesday StrCmp $0 4 0 +2 StrCpy $0 Thursday StrCmp $0 5 0 +2 StrCpy $0 Friday StrCmp $0 6 0 +2 StrCpy $0 Saturday StrCmp $0 0 0 +2 StrCpy $0 Sunday MessageBox MB_OK 'GetWeekdayName$\n$$0={$0}' #GetMondayDate: !define Monday 1 !define Tuesday 2 !define Wednesday 3 !define Thursday 4 !define Friday 5 !define Saturday 6 !define Sunday 7 #!define Sunday 0 time::MathTime "day(29.12.2005 0:0:0) + 5 % 7 =" .r0 time::MathTime "day(29.12.2005 0:0:0) - $0 + ${Monday} = date" .r0 MessageBox MB_OK 'GetMondayDate$\n$$0={$0}' SectionEnd

__________________
my functions

Quick Link | Report this post to a moderator | IP: Logged

Instructor is offline Old Post 01-04-2006 08:26 PM
Click Here to See the Profile for Instructor Click here to Send Instructor a Private Message Click Here to Email Instructor Visit Instructor's homepage! Find more posts by Instructor Add Instructor to your buddy list Edit/Delete Message Reply w/Quote
Instructor
Major Dude

Registered: Jul 2004
From:

Added: "MathTime" now can parse negative values ("-10 + -20 =" returns -30)


"Time" plugin v1.4

Attachment: time.zip
This has been downloaded 686 time(s).

__________________
my functions

Quick Link | Report this post to a moderator | IP: Logged

Instructor is offline Old Post 01-04-2006 10:02 PM
Click Here to See the Profile for Instructor Click here to Send Instructor a Private Message Click Here to Email Instructor Visit Instructor's homepage! Find more posts by Instructor Add Instructor to your buddy list Edit/Delete Message Reply w/Quote
Comperio
Major Dude

Registered: Jan 2005
From: Oregon Coast

D'OH! I feel like such a dolt! I looked over the readme doc several times and didn't see the example about getting the day of the week until you posted your reply!

Thanks for posting the example. This should work quite nicely!

Quick Link | Report this post to a moderator | IP: Logged

Comperio is offline Old Post 01-05-2006 12:25 AM
Click Here to See the Profile for Comperio Click here to Send Comperio a Private Message Find more posts by Comperio Add Comperio to your buddy list Edit/Delete Message Reply w/Quote
Instructor
Major Dude

Registered: Jul 2004
From:

Fixed: time::MathTime now error output is "" not "-1" (negative results allowed).
Changed: time::SetFileTime now don't changes any file time if error appeared.
Updated: example "Compare times".
Updated: "ConvFunc.h" to v1.6.
Changed: Now plugin used header "Time.nsh" for custom user variables and
              better compile errors check.

Update from previous versions:
         - Insert line in script:
            !include "Time.nsh"
         - Replace:
            time::SetLocalTime -> ${time::SetLocalTime} ...
         - Replace:
            .r0 -> $0, .r1 -> $1 ... .R0 -> $R0, .R1 -> $R1 ...

"Time" plugin v1.5

Attachment: time.zip
This has been downloaded 714 time(s).

__________________
my functions

Quick Link | Report this post to a moderator | IP: Logged

Instructor is offline Old Post 03-16-2006 09:11 PM
Click Here to See the Profile for Instructor Click here to Send Instructor a Private Message Click Here to Email Instructor Visit Instructor's homepage! Find more posts by Instructor Add Instructor to your buddy list Edit/Delete Message Reply w/Quote
stb
Senior Member

Registered: Mar 2004
From: Germany, Paderborn

Hi Instructor,

I tried something like

${time::MathTime} "day(27.03.2006 12:00:00) - day(15.05.2006 17:00:00) = day"

and got "" (error). You wrote "negative results allowed" (post above), so it should be something like "-50" (or nearby).

__________________
http://stefan.bertels.org/

Quick Link | Report this post to a moderator | IP: Logged

stb is offline Old Post 03-27-2006 10:42 AM
Click Here to See the Profile for stb Click here to Send stb a Private Message Click Here to Email stb Visit stb's homepage! Find more posts by stb Add stb to your buddy list Edit/Delete Message Reply w/Quote
Instructor
Major Dude

Registered: Jul 2004
From:

Rough result:
"day(27.03.2006 12:00:00) - day(15.05.2006 17:00:00) ="

I'll check later for accurate negative result possibility:
"second(27.03.2006 12:00:00) - second(15.05.2006 17:00:00) = day"

__________________
my functions

Quick Link | Report this post to a moderator | IP: Logged

Instructor is offline Old Post 03-27-2006 12:43 PM
Click Here to See the Profile for Instructor Click here to Send Instructor a Private Message Click Here to Email Instructor Visit Instructor's homepage! Find more posts by Instructor Add Instructor to your buddy list Edit/Delete Message Reply w/Quote
Instructor
Major Dude

Registered: Jul 2004
From:

Added: "MathTime" now can accept negative values in the result conversion -
            after "=", but except "= date".


"Time" plugin v1.6

Attachment: time.zip
This has been downloaded 776 time(s).

__________________
my functions

Quick Link | Report this post to a moderator | IP: Logged

Instructor is offline Old Post 03-28-2006 01:03 PM
Click Here to See the Profile for Instructor Click here to Send Instructor a Private Message Click Here to Email Instructor Visit Instructor's homepage! Find more posts by Instructor Add Instructor to your buddy list Edit/Delete Message Reply w/Quote
stb
Senior Member

Registered: Mar 2004
From: Germany, Paderborn

Hi Instructor,

1. thanks!

2. "-v" please. Does that mean I can use "= second" now and compare using IntCmp 86400 (instead of 1)?

__________________
http://stefan.bertels.org/

Quick Link | Report this post to a moderator | IP: Logged

stb is offline Old Post 03-28-2006 07:53 PM
Click Here to See the Profile for stb Click here to Send stb a Private Message Click Here to Email stb Visit stb's homepage! Find more posts by stb Add stb to your buddy list Edit/Delete Message Reply w/Quote
Instructor
Major Dude

Registered: Jul 2004
From:

quote:
"-v" please. Does that mean I can use "= second" now and compare using IntCmp 86400 (instead of 1)?
I don't understand. The new version allow you to write the next expression
code:
"second(27.03.2000 12:00:00) - second(15.05.2006 17:00:00) = day"
Result will be "-2240" - days between dates.

__________________
my functions

Quick Link | Report this post to a moderator | IP: Logged

Instructor is offline Old Post 03-28-2006 08:26 PM
Click Here to See the Profile for Instructor Click here to Send Instructor a Private Message Click Here to Email Instructor Visit Instructor's homepage! Find more posts by Instructor Add Instructor to your buddy list Edit/Delete Message Reply w/Quote
torpark
Senior Member

Registered: Apr 2006
From:

I am unable to get time.dll to unload, even with

quote:
Function .onGUIend
RMDir /r $PLUGINSDIR
FunctionEnd

Quick Link | Report this post to a moderator | IP: Logged

torpark is offline Old Post 09-18-2006 05:06 AM
Click Here to See the Profile for torpark Click here to Send torpark a Private Message Click Here to Email torpark Visit torpark's homepage! Find more posts by torpark Add torpark to your buddy list Edit/Delete Message Reply w/Quote
Instructor
Major Dude

Registered: Jul 2004
From:

code:
${time::Unload}

__________________
my functions

Quick Link | Report this post to a moderator | IP: Logged

Instructor is offline Old Post 09-18-2006 12:51 PM
Click Here to See the Profile for Instructor Click here to Send Instructor a Private Message Click Here to Email Instructor Visit Instructor's homepage! Find more posts by Instructor Add Instructor to your buddy list Edit/Delete Message Reply w/Quote
tpr
Junior Member

Registered: Jan 2007
From:

Thanks for the plugin.

I am a beginner and would like to make a simple exe which sets local date back to 10 years and another one which sets the actual date.

I successfully created an exe which sets date back but don't know how to restore the actual date (and time).

If someone could help I would really appreciate it.

Thanks
tpr

Edit: problem solved, I've overlooked TimeTest.nsi

Last edited by tpr on 01-20-2007 at 08:05 AM

Quick Link | Report this post to a moderator | IP: Logged

tpr is offline Old Post 01-20-2007 06:39 AM
Click Here to See the Profile for tpr Click here to Send tpr a Private Message Click Here to Email tpr Find more posts by tpr Add tpr to your buddy list Edit/Delete Message Reply w/Quote
gringoloco023
Junior Member

Registered: Nov 2009
From:

Unicode NSIS

Hello Instructor,

I hope you are still actively developing the Time plug-in?
Because, I am (we are) looking for this plug-in, recompiled to work with Unicode NSIS.
It would be really appreciated, as we are in need of a fair few plug-ins with Unicode NSIS support!

Link to Unicode NSIS homepage: scratchpaper.com/home
Link our project: portableapps.com/node/21879

Thanx a lot, in advance !

Quick Link | Report this post to a moderator | IP: Logged

gringoloco023 is offline Old Post 01-21-2010 03:52 PM
Click Here to See the Profile for gringoloco023 Click here to Send gringoloco023 a Private Message Click Here to Email gringoloco023 Find more posts by gringoloco023 Add gringoloco023 to your buddy list Edit/Delete Message Reply w/Quote
All times are GMT. The time now is 07:39 PM. Post New Thread    Post A Reply
  Last Thread   Next Thread
WINAMP.COM | Forums : Powered by vBulletin version 2.3.9 WINAMP.COM | Forums > Developer Center > NSIS Discussion > Time plugin
Show Printable Version
 | 
Email this Page
 | 
Subscribe to this Thread

Forum Jump:
 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is off
vB code is ON
Smilies are ON
[IMG] code is ON