JS Date issue

 5 Replies
 0 Subscribed to this topic
 52 Subscribed to this forum
Sort:
Author
Messages
Kenn Becker
New Member Send Private Message
Posts: 0
New Member
I am building a process flow that  will require DateDiff to determine an employee's length of service. I have 2 variables, AdjSvcDate and Today that have Date specified for the type and  the default is today(). When I run the flow it retrieves  the correct dates but when determining the variables today() becomes:1.341961925884E12.

Executing Start Activity...
  Employee = 0
  Company = 0
  AdjSvcDate = Tue Jul 10 2012 16:12:05 GMT-0700 (MST)
  Today = Tue Jul 10 2012 16:12:05 GMT-0700 (MST)
  Variables:
  Today(Type=Date) = 1.341961925884E12
  AdjSvcDate(Type=Date) = 1.341961925883E12
  Company(Type=Integer) = 0
  Employee(Type=Integer) = 0

Any help with this would be appreciated.
Kenn
David Williams
Veteran Member Send Private Message
Posts: 1127
Veteran Member
Where is this section coming into play?
Variables:
Today(Type=Date) = 1.341961925884E12

Are you reassigning values to your dates in an Assign node?

David Williams
Kenn Becker
New Member Send Private Message
Posts: 0
New Member
Yes, I have them set up in an Assign as:
AdjSvcDate = pfDate(Emp_ADJ_HIRE_DATE,'mm/dd/yyyy')
Today = today()

When it calls the db, it retrieves the correct data but when it processes the variables it changes to the string:

AdjSvcDate = Mon May 14 2012 00:00:00 GMT-0700 (MST)

Today = Wed Jul 11 2012 10:17:16 GMT-0700 (MST)

Variables in Process:

Today = 1.34202703652E12

AdjSvcDate = 1.3369788E12

SP
Veteran Member Send Private Message
Posts: 122
Veteran Member
What kind of math functions are you attempting to perform and can you show
an example of the calls to datediff?

On Wed, Jul 11, 2012 at 12:23 PM, wrote:

> [image: LawsonGuru.com Logo] <https://www.lawsonguru.com/> Lawson
> ProcessFlow Forum Notification A message was posted to a thread you are
> tracking. *RE: JS Date issue* Posted by: *Kenn Becker*
> 07/11/2012 11:22 AM Yes, I have them set up in an Assign as:
> AdjSvcDate = pfDate(Emp_ADJ_HIRE_DATE,'mm/dd/yyyy')
> Today = today()
>
> When it calls the db, it retrieves the correct data but when it processes
> the variables it changes to the string:
>
> AdjSvcDate = Mon May 14 2012 00:00:00 GMT-0700 (MST)
>
> Today = Wed Jul 11 2012 10:17:16 GMT-0700 (MST)
>
> Variables in Process:
>
> Today = 1.34202703652E12
>
> AdjSvcDate = 1.3369788E12
> ------------------------------
>
> To view the complete thread and reply via your browser, please visit:
> http://www.inforguru.com/...pflow/js-date-issue/
>
> You were sent this email because you opted to receive email notifications
> when someone posted and/or responded to a message on this forum.
> To unsubscribe to this thread please visit your user profile page and
> change your subscription options.
>
> Thank you,
> LawsonGuru.com
>

Robert Spurr
Veteran Member Send Private Message
Posts: 130
Veteran Member
When you look at the dates in the debug or in a log it displays them in that fashion which makes it hard to read. I have a flow were I determine the age of an Invoice and if is greater than so many days I want to process it and this is what I did.

Defined variables:
vDays = 0 (int)
vToday = today() (Date)
vInvoiceCreate = today (Date)

Assign the DME date returned to vInvoiceCreate - pfDate(QINVOICE_CREATE_DATE,'mm/dd/yyyy')

Assign vDays = DateDiff(vToday,vInvCreate)

Hope That Helps
Robert
Kenn Becker
New Member Send Private Message
Posts: 0
New Member
Thank you very much, Robert. I set it up exactly the same way and it worked perfectly.
Kenn