Page 1 of 1

Help: What is code for calling today's date

Posted: Wed Jan 14, 2009 9:36 am
by ashishg
Noob alert: please help.

I am trying to write a simple script that will give me play counter per 100 days. I am using it to list my favourite songs. I am currently using LastPlayed so that play count per 100 day at date of last played is computed.

Code: Select all

itm.Custom3 = ((itm.PlayCounter - 1) * 100) / (itm.LastPlayed - itm.DateAdded)
I'd like to be able to us today's date. So code should look something like

Code: Select all

itm.Custom3 = (itm.PlayCounter * 100) / ([b]<today>[/b] - itm.DateAdded)
I think it should be something easy but I can't find in script help file. Thanks.

Re: Help: What is code for calling today's date

Posted: Wed Jan 14, 2009 11:55 am
by raybeau528
You probably need to use the VBscript DATE function and related functions (DateDiff, DatePart, etc).

Ray

Re: Help: What is code for calling today's date

Posted: Wed Jan 14, 2009 4:41 pm
by ashishg
Thanks. Problem solved. Pls delete this thread as I cannot find a way to do so.

Re: Help: What is code for calling today's date

Posted: Wed Jan 14, 2009 4:54 pm
by Teknojnky
you should be able to delete it by editing the initial post and checking the box for delete, but really there is no need as perhaps someone else may have the same question.

Re: Help: What is code for calling today's date

Posted: Wed Jan 14, 2009 8:00 pm
by Peke
I must confess that I do not understand request/question :oops: :-? :(

Re: Help: What is code for calling today's date

Posted: Thu Jan 15, 2009 1:41 am
by MoDementia
Looking for this I think

Code: Select all

    LastExportDate = Cdbl(Now)
but you might have to add/subtract 26k from it to match MM

I have done the code before but can't remember which script :(

Bex knows it off by heart ;)