Thread: getTimeStamp()
View Single Post
  #22  
Old 11-07-2008, 06:56 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by LoneAngelIbesu View Post
Not using a single function, it doesn't.

PHP Code:
function hellRavenFormalTime() {
  
temp.ctime adjustTimeZone(timevar2,-5); // to EST
  
temp.date getDate(temp.ctime);
  
temp.clock = {getHour(temp.ctime),getMinutes(temp.ctime),getSeconds(temp.ctime)};
  return 
getFormalDayEnglish(getWeekday(temp.ctime)) @ ", " @
         
getFormalMonthEnglish(temp.date[1]) SPC getFormalNumber(temp.date[2]) @ ", " temp.date[0] @ " @ " @
         
to12Hour(temp.clock[0]) @ ":" doubleDigit(temp.clock[1]) @ ":" doubleDigit(temp.clock[2]) SPC getAMPM(temp.clock[0]) SPC "EST";

PHP Code:
function timestamp() {
  return 
shared.date("l, F jS, @ g:i:s a T");

Which one do you think somebody new to GS2 would be able to use more easily? You guys seem to think that every scripter on Graal is an expert.

PHP Code:
public function getTimeStamp(timezone) {
  
temp.ctime adjustTimeZone(timevar2timezone);
  
temp.date getDate(temp.ctime);
  
temp.clock = {getHour(temp.ctime),getMinutes(temp.ctime),getSeconds(temp.ctime)};
  return 
getFormalDayEnglish(getWeekday(temp.ctime)) @ ", " @
         
getFormalMonthEnglish(temp.date[1]) SPC getFormalNumber(temp.date[2]) @ ", " temp.date[0] @ " @ " @
         
to12Hour(temp.clock[0]) @ ":" doubleDigit(temp.clock[1]) @ ":" doubleDigit(temp.clock[2]) SPC getAMPM(temp.clock[0]) SPC "EST";

and then you could do

PHP Code:
this.join("functions_time"// or whatever you named the class where the function is
function onCreated() {
  
sendtorc(getTimeStamp(1));
  
sendtorc(getTimeStamp(-5));

  
// getTimeStamp(timezone)

I don't see any problem using HR's.. All you would have to do is make it so the function returns the proper timezone.. which shouldn't be a problem at all..
__________________
Reply With Quote