Please login or register.

Login with username, password and session length
Advanced search  

News:

The Buster PiX10Hub is here! Created by the Community, for the Community.:)% #:)

Author Topic: Time difference on <recvrf>  (Read 8815 times)

hkactive

  • Full Member
  • ***
  • Helpful Post Rating: 1
  • Posts: 50
Time difference on <recvrf>
« on: May 15, 2006, 04:38:30 PM »

Hi:

Am using the following VB6 code using the ActiveHome control with a CM15A. And I am using a PowerHouse Platinum Remote (UR73A) to send the signal to the CM15A.

Private Sub ActiveHome1_RecvAction(ByVal bszAction As Variant, ByVal bszParm1 As Variant, _
    ByVal bszParm2 As Variant, ByVal bszParm3 As Variant, ByVal bszParm4 As Variant, _
    ByVal bszParm5 As Variant, ByVal bszReserved As Variant)
    If bszParm1 = vbNullString Then bszParm1 = "null-1"
    If bszParm2 = vbNullString Then bszParm2 = "null-2"
    If bszParm3 = vbNullString Then bszParm3 = "null-3"
    If bszParm4 = vbNullString Then bszParm4 = "null-4"
    If bszParm5 = vbNullString Then bszParm5 = "null-5"
    If bszReserved = vbNullString Then bszReserved = "Reserved-Null"
    Debug.Print bszAction, bszParm1, bszParm2, bszParm3, bszParm4, bszParm5, bszReserved
End Sub

This is what prints out when the Receive Event is triggered by the CM15A:

recvrf        e1            Off            0            5/15/2006 8:17:15 PM        null-5        Reserved-Null

However, the actual time on my computer is 4:17 p.m.

Anybody know why there is an exact 4 hour difference? And possibly how to rectify the situation so that the time matches the computer time?

Thanks,

Hank
Logged

roger1818

  • Hero Member
  • *****
  • Helpful Post Rating: 28
  • Posts: 1072
  • Roger H.
Re: Time difference on <recvrf>
« Reply #1 on: May 15, 2006, 04:44:56 PM »

What Timezone are you in?  My guess is that it is returning the time in UTC.  Check if VB has a function for converting from UTC to local time.
Logged

hkactive

  • Full Member
  • ***
  • Helpful Post Rating: 1
  • Posts: 50
Re: Time difference on <recvrf>
« Reply #2 on: May 15, 2006, 05:00:11 PM »

I'm in  the Eastern Standard Time (EST) Zone.

Right now it's 4:45 p.m.

Latest result:

recvrf        f1            On             0            5/15/2006 8:46:00 PM        null-5        Reserved-Null

Using the print now function in the debug window produces the following.

print now
5/15/2006 4:46:53 PM

Looks like the CM15A is converting the time and not VB?

Hank
Logged

billy

  • Sr. Member
  • ****
  • Helpful Post Rating: 7
  • Posts: 110
Re: Time difference on <recvrf>
« Reply #3 on: May 15, 2006, 10:30:23 PM »


Yes, it uses UTC, but it's not just the CM15A the CM19A also reports UTC.
I believe it's coming from the X10Nets service.

You need to convert UTC to local time in VB.

Logged
"I would rather live my life as if there is a God and die to find out there isn't, than live my life as if there isn't and die to find out there is."  Albert Camus
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.