GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Hey is there a javascript that tells you the date right now? (https://gfy.com/showthread.php?t=623502)

clickhappy 06-19-2006 12:16 PM

Hey is there a javascript that tells you the date right now?
 
So I can say "Last Updated on: ____" and it'll just print todays date?

Its an .html age so I can I do it with php? without naming the page .php?

pstation 06-19-2006 12:17 PM

yeah, simple to do without a server-side language

flashbang 06-19-2006 12:18 PM

<SCRIPT language="JavaScript" type="text/javascript">
<!--
// current date - from http://rainbow.arch.scriptmania.com/scripts
// Array of day names
var dayNames = new Array("Sunday","Monday","Tuesday","Wednesday","Thu rsday","Friday","Saturday");

var monthNames = new Array("January","February","March","April","May"," June","July",
"August","September","October","November","Decembe r");

var dt = new Date();
var y = dt.getYear();

// Y2K compliant
if (y < 1000) y +=1900;

document.write(dayNames[dt.getDay()] + ", " + monthNames[dt.getMonth()] + " " + dt.getDate() + ", " + y);
// -->
</SCRIPT>


you can do it with php and a .html page but that is beyond the scope of this thread :)

pstation 06-19-2006 12:18 PM

Code:

<script type="text/javascript">
document.write(Date())
</script>


Tom_PM 06-19-2006 12:19 PM

Nope, it's impossible.

j/k, lol

emmanuelle 06-19-2006 12:20 PM

<SCRIPT language=JavaScript>

days = new Array(7)
days[1] = "Sunday";
days[2] = "Monday";
days[3] = "Tuesday";
days[4] = "Wednesday";
days[5] = "Thursday";
days[6] = "Friday";
days[7] = "Saturday";
months = new Array(12)
months[1] = "January";
months[2] = "February";
months[3] = "March";
months[4] = "April";
months[5] = "May";
months[6] = "June";
months[7] = "July";
months[8] = "August";
months[9] = "September";
months[10] = "October";
months[11] = "November";
months[12] = "December";
today = new Date(); day = days[today.getDay() + 1]
month = months[today.getMonth() + 1]
date = today.getDate()
year=today.getYear();
if (year < 2000)
year = year + 1900;
document.write ("<font class='welcome' color=white> "+ day +
", " + month + " " + date + ", " + year + "</font>")
// -- end hiding
</SCRIPT>

clickhappy 06-19-2006 12:22 PM

Quote:

Originally Posted by pstation
Code:

<script type="text/javascript">
document.write(Date())
</script>


that works
do you know how to shorten it so it only gives todays date?

Mon Jun 19 2006 15:21:36 GMT-0400 (Eastern Standard Time)

I just want it to say Jun 19 2006

DutchTeenCash 06-19-2006 12:23 PM

<java>
the date right now
</java>

clickhappy 06-19-2006 12:25 PM

nm got it now thanks.

Tom_PM 06-19-2006 12:25 PM

This will do only the month and day #:
<script type="text/javascript">
document.write(Date().substring(4,10))
</script>


All times are GMT -7. The time now is 04:38 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123