Difference between revisions of "Pandora - Sample - Obtain Current Server Time"

From SmartWiki
Jump to: navigation, search
(Created page with 'This following will obtain the server time in real time. ss_developer_key="xxxxxxxxxxxxxxxxxxxxxxxxxxx” var rs=session_getuser(false,'','now() as currentdate'); thedate=…')
 
Line 1: Line 1:
This following will obtain the server time in real time.
+
This following will obtain the server time in real time, formatted as yyyy-mm-dd HH:mm:ss
  
 
   ss_developer_key="xxxxxxxxxxxxxxxxxxxxxxxxxxx”
 
   ss_developer_key="xxxxxxxxxxxxxxxxxxxxxxxxxxx”
Line 10: Line 10:
 
* This method is often preferred to using JavaScript to obtain the current time. JavaScript uses the time on the client machine, which doesn't take time zones into consideration and is also configurable by the user so can bypass submission time restrictions etc.
 
* This method is often preferred to using JavaScript to obtain the current time. JavaScript uses the time on the client machine, which doesn't take time zones into consideration and is also configurable by the user so can bypass submission time restrictions etc.
 
* You will need to enable the ''Find'' permission on ''Session_CurrentUser'' within the [[Pandora Security Matrix]]
 
* You will need to enable the ''Find'' permission on ''Session_CurrentUser'' within the [[Pandora Security Matrix]]
 +
 +
 +
==See Also==
 +
* [[Obtain Server Date and Time]]
  
 
[[Category:Pandora]]
 
[[Category:Pandora]]

Revision as of 18:54, 7 January 2013

This following will obtain the server time in real time, formatted as yyyy-mm-dd HH:mm:ss

 ss_developer_key="xxxxxxxxxxxxxxxxxxxxxxxxxxx”
 var rs=session_getuser(false,,'now() as currentdate');
 thedate=rs.getfieldbyname(1,"now() as currentdate");
 alert(thedate);


Notes

  • This method is often preferred to using JavaScript to obtain the current time. JavaScript uses the time on the client machine, which doesn't take time zones into consideration and is also configurable by the user so can bypass submission time restrictions etc.
  • You will need to enable the Find permission on Session_CurrentUser within the Pandora Security Matrix


See Also