Home » SQL & PL/SQL » SQL & PL/SQL » Format Time
Format Time [message #197975] Fri, 13 October 2006 09:51 Go to next message
Duane
Messages: 452
Registered: December 2002
Senior Member
Anyone know how to put time in this format:
time=1139331600

Based on this:

The time, in seconds, when you generate the token data string. Specify time as the number of seconds from the epoch (midnight January 1, 1970), normalized to Greenwich Mean Time (GMT). Specify time as base 10, without leading zeros or
trailing decimals. For example: 1139331600.
To ensure that your time is synchronized with the iTunes U server time, set your institution’s server time to network time (NTP).
Re: Format Time [message #197976 is a reply to message #197975] Fri, 13 October 2006 09:59 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
SQL> select trunc((sysdate - to_date('01-01-1970','dd-mm-yyyy'))*24*60*60)
  2  from   dual;

TRUNC((SYSDATE-TO_DATE('01-01-1970','DD-MM-YYYY'))*24*60*60)
------------------------------------------------------------
                                                  1160755089
Re: Format Time [message #197977 is a reply to message #197975] Fri, 13 October 2006 10:06 Go to previous messageGo to next message
Duane
Messages: 452
Registered: December 2002
Senior Member
Hey thanks.

Any idea on how to do a SHA256 secure hash?
Re: Format Time [message #197981 is a reply to message #197977] Fri, 13 October 2006 10:38 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10672
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Look for DBMS_OBFUSCATION_TOOLKIT
Re: Format Time [message #203831 is a reply to message #197975] Thu, 16 November 2006 08:58 Go to previous messageGo to next message
Duane
Messages: 452
Registered: December 2002
Senior Member
Could someone explain the parts of this statement so that I have a better understanding of how it works so that I can change/modifiy it.

I don't understand what *24*60*60 is doing.

trunc((sysdate - to_date('01-01-1970','dd-mm-yyyy'))*24*60*60)
Re: Format Time [message #203839 is a reply to message #203831] Thu, 16 November 2006 09:20 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
24 (hours in the day)
*
60 (minutes in the hour)
*
60 (seconds in the minute)

It's a constant to multiply a number of days by to convert it to a number of seconds.
Re: Format Time [message #203843 is a reply to message #197975] Thu, 16 November 2006 09:37 Go to previous message
Duane
Messages: 452
Registered: December 2002
Senior Member
Ah, ok, that makes sense.

Then, I don't understand why the iTunesU servers is telling me my time in too far in the past. I use your function to calculate the time before I send the URL to the iTunesU server.

I get this message:
"The time string has a valid format but it corresponds to the time 2006-11-16 09:18:01Z, which is too far in the past."

time 

The time, in seconds, when you generate the token data. Specify time as the number
of seconds from the epoch (midnight January 1, 1970), normalized to Greenwich
Mean Time (GMT). Specify time as base 10, without leading zeros or trailing decimals.
For example: 1139331600.
If your server’s clock is not synchronized with the iTunes U server, authentication fails.
To ensure that your time is synchronized with the iTunes U server time, set your
institution’s server time to network time (NTP).
iTunes U uses the token generation time to establish a login session. A login session
is the duration of time, 90 seconds by default, that your authentication and
authorization privileges are valid. If you access iTunes U after the token generation
time has expired, iTunes U directs you to the site’s login page. For a site available to
the public, iTunes U ignores the token, logs you in as a public visitor, and displays
only public information in the site.
Previous Topic: Yes or NO
Next Topic: How to create a grand total from multiple SELECTs
Goto Forum:
  


Current Time: Fri Dec 02 18:31:02 CST 2016

Total time taken to generate the page: 0.24086 seconds