Get date/Time for your webpage via –

Have you ever wondered how do some great websites show the latest date and time, every time you go there or reload the page. What script in the world are they using ? Heck, man! They’re pretty neat effects. Have you ever wondered, how you can get those ? Read along :-Well, the real secret is that these great websites use PHP (Hypertext pre-processor). Sounds bad, codey, geeky, doesn’t it. Well, let me do the hard work for you. I’ve read this a lot and got a simple solution for the problem. All we do is we. Stop. I’ll explain you later. first, you see the code :-

My <span class="hiddenSpellError" pre="My ">php</span> script

......(other code)

<!--?<span class="hiddenSpellError" pre=""-->php
$todaysdate = date("m",time()) . "-" . date("d",time()) . "-"

echo $todaysdate;

So, as you can see in the script above, we make a simple php call which makes a variable called todaysdate and appends a value of the time, date, year. And, finally, it echoes todaysdate on the webpage. Simple ! You can use this variable anywhere on the webpage, footer, header, etc. and get yourself going. Great, today we have another tool in our arsenal !

Cheers . Until next time.

Enter your email address to follow this blog and receive notifications of new posts by email.

2 thoughts on “Get date/Time for your webpage via –

Add your Awesome voice. Let's have a meaningful conversation. And remember, don't be a spammer (We hate 'em).

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s