generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: You guys know how to get PDT time in JS?

Previous Thread :: Next Thread 
Megamatrixdude is not online. Megamatrixdude
Joined: 06 Dec 2009
Total Posts: 10939
12 Aug 2011 04:00 PM
Google is not my friend.

-[Insert witty comment here]
Report Abuse
ThisIsSPORE is not online. ThisIsSPORE
Joined: 24 Jun 2011
Total Posts: 2402
12 Aug 2011 04:03 PM
I don't know about JavaScript but you can use PHP :P

date_default_timezone_set('America/Los_Angeles');
Report Abuse
ArceusInator is not online. ArceusInator
Joined: 10 Oct 2009
Total Posts: 30553
12 Aug 2011 04:04 PM
No one cares abotu php.
Report Abuse
ThisIsSPORE is not online. ThisIsSPORE
Joined: 24 Jun 2011
Total Posts: 2402
12 Aug 2011 04:04 PM
I do. D:
Report Abuse
Megamatrixdude is not online. Megamatrixdude
Joined: 06 Dec 2009
Total Posts: 10939
12 Aug 2011 04:04 PM
I don't think PHP is much use for a supposedly light-weight chrome extension.

-[Insert witty comment here]
Report Abuse
LocalChum is not online. LocalChum
Joined: 04 Mar 2011
Total Posts: 6906
12 Aug 2011 04:06 PM
I care about PHP D:
Report Abuse
ArceusInator is not online. ArceusInator
Joined: 10 Oct 2009
Total Posts: 30553
12 Aug 2011 04:06 PM
Think about what I'm gonna do on my computer when I get home all day

Forget when I get on my computer
Report Abuse
ThisIsSPORE is not online. ThisIsSPORE
Joined: 24 Jun 2011
Total Posts: 2402
12 Aug 2011 04:07 PM
@Arceus

I always do that... D:
Report Abuse
Person299 is not online. Person299
Joined: 28 Feb 2008
Total Posts: 7952
12 Aug 2011 04:09 PM
I love PHP.
Report Abuse
Piedude777 is not online. Piedude777
Joined: 01 Oct 2008
Total Posts: 10017
12 Aug 2011 04:10 PM
var date = new Date();
var localtime = date.getTime();
var timeoffset = data.getTimezoneOffset() * 60000;
var basetime = localtime + timeoffset
var PDTtime = basetime + (3600000*-7);
Report Abuse
ThisIsSPORE is not online. ThisIsSPORE
Joined: 24 Jun 2011
Total Posts: 2402
12 Aug 2011 04:11 PM
@Arceus

owned localchum is on my side

trolololo
Report Abuse
Megamatrixdude is not online. Megamatrixdude
Joined: 06 Dec 2009
Total Posts: 10939
12 Aug 2011 04:26 PM
@Pie

But what if someone is in a different time zone to that? How j00 get it to work without overkill-maths?

-[Insert witty comment here]
Report Abuse
Piedude777 is not online. Piedude777
Joined: 01 Oct 2008
Total Posts: 10017
12 Aug 2011 04:28 PM
@ Mega

It should always return the PDT time no matter what time zone you're in.
Report Abuse
Megamatrixdude is not online. Megamatrixdude
Joined: 06 Dec 2009
Total Posts: 10939
12 Aug 2011 04:40 PM
@Pie

Ok, so would the PDTTime thing represent milliseconds since 1970?

-[Insert witty comment here]
Report Abuse
Piedude777 is not online. Piedude777
Joined: 01 Oct 2008
Total Posts: 10017
12 Aug 2011 04:44 PM
Add this to the end and you get the PDT date time:

time = new Date(PDTtime)
Report Abuse
Megamatrixdude is not online. Megamatrixdude
Joined: 06 Dec 2009
Total Posts: 10939
12 Aug 2011 04:52 PM
Oh, thanks. :D

-[Insert witty comment here]
Report Abuse
Piedude777 is not online. Piedude777
Joined: 01 Oct 2008
Total Posts: 10017
12 Aug 2011 04:55 PM
Is this going to be used in your siggy extension?
Report Abuse
Megamatrixdude is not online. Megamatrixdude
Joined: 06 Dec 2009
Total Posts: 10939
12 Aug 2011 05:05 PM
"Your" I modified it, but thank you.

I was actually going to make an entirely new extension which gives you roblox time.

-[Insert witty comment here]
Report Abuse
Megamatrixdude is not online. Megamatrixdude
Joined: 06 Dec 2009
Total Posts: 10939
12 Aug 2011 05:06 PM
If I like to this in a background html document, it should work right?

function updateTime()
{
var Time = new Date()
var localtime = Time.getTime();
var timeoffset = Time.getTimezoneOffset() * 60000;
var basetime = localtime + timeoffset
var PDTtime = basetime + (3600000*-7);

PDTCurrentTime = new Date(PDTtime)
var h = PDTCurrentTime.getHours()
var m = PDTCurrentTime.getMinutes()
var s = PDTCurrentTime.getSeconds()
var formattedTimed = h + m
chrome.browserAction.setBadgeText({text:formattedTime})
}

while (5 == 5)
{
var t=setTimeout("updateTime()", 1000)
}

-[Insert witty comment here]
Report Abuse
Piedude777 is not online. Piedude777
Joined: 01 Oct 2008
Total Posts: 10017
12 Aug 2011 05:07 PM
Maybe. I don't know JavaScript.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image