Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
hugetv
Visitor

help with more time

help with more time

<Active expires="1310598793">Keys</Active>

I want to know when time is this and as put you more time to make last in expire
Our system http://www.rokumanager.com
0 Kudos
9 REPLIES 9
destruk
Streaming Star

Re: help with more time

If that's a unix epoch timestamp it expired in 2011...
http://www.epochconverter.com/
0 Kudos
hugetv
Visitor

Re: help with more time

this code

if dt.AsSeconds() > Active.expires

is that not is how works this code what if it is that fast expires very
Our system http://www.rokumanager.com
0 Kudos
destruk
Streaming Star

Re: help with more time

if dt is rodatetime, then yeah, that's probably how it works.
AsSeconds() as Integer
Returns the date/time as the number of seconds from the Unix epoch (00:00:00 1/1/1970 GMT)

But it is after 2011, so it will always be expired as long as you're using
<Active expires="1310598793">Keys</Active>

You might try Active@expires for your parsing routine - I don't think active.expires is correct there.
0 Kudos
TheEndless
Channel Surfer

Re: help with more time

"destruk" wrote:
if dt is rodatetime, then yeah, that's probably how it works.
AsSeconds() as Integer
Returns the date/time as the number of seconds from the Unix epoch (00:00:00 1/1/1970 GMT)

But it is after 2011, so it will always be expired as long as you're using
<Active expires="1310598793">Keys</Active>

You might try Active@expires for your parsing routine - I don't think active.expires is correct there.

You'd also need to parse the value as an integer, since it'll be a string in the XML.
' Get current time
dt = CreateObject("roDateTime")
If dt.AsSeconds() > xml.Active@expires.ToInt() Then
' expired
Else
' not expired
End If
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
hugetv
Visitor

Re: help with more time

the problem is that in 15-second expires the code and I want it to expire in 2 minute
Our system http://www.rokumanager.com
0 Kudos
destruk
Streaming Star

Re: help with more time

So rather than dt.asseconds()+15, why not use dt.asseconds()+120 ?
0 Kudos
hugetv
Visitor

Re: help with more time

this code

      if dt.AsSeconds() > Active.expires
' the code expired. display a message, then get a new one
d = CreateObject("roMessageDialog")
dPort = CreateObject("roMessagePort")
d.SetMessagePort(dPort)
d.SetTitle("Code Expired")
d.SetText("This code has expired. Press OK to get a new one")
d.AddButton(1, "OK")
d.Show()

Wait(0, dPort)
d.Close()
screen.SetRegistrationCode("Retrieving...")
screen.Show()

linkingCode = GetLinkingCode()
if linkingCode <> invalid
screen.SetRegistrationCode(linkingCode.code)
else
screen.SetRegistrationCode("Failed to get code...")
end if
screen.Show()
end if
Our system http://www.rokumanager.com
0 Kudos
destruk
Streaming Star

Re: help with more time

Would you be able to change the expires value given out by your server?
0 Kudos
hugetv
Visitor

Re: help with more time

I have updated the automatic date in the code's expiry

but the problem is continuing to exhale the code in 15 second
Our system http://www.rokumanager.com
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.