/    Sign up×
Community /Pin to ProfileBookmark

How to show current day date in meta title of a page?

Hello,
Is there any method to show current date in meta title of a page in a html website ?

to post a comment
HTMLJavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@VITSUSADec 25.2019 — Click on mentioned hyperlink to know more about how to show current date in meta title of a page in a html website -

https://kb.yoast.com/kb/yoast-wordpress-seo-titles-metas-template-variables/
Copy linkTweet thisAlerts:
@shobhaauthorDec 26.2019 — @VITSUSA#1612168 I want to show date in non-wordpress website.
Copy linkTweet thisAlerts:
@branadamDec 30.2019 — I think This Pattern Follow

<html>

<head>

<meta charset="utf-8" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<title> </title>

<meta name="description" content="There may be many reasons why you cannot login to webmail. Check your username and password.">

<script>

var dayNames = new Array("Sunday","Monday","Tuesday","Wednesday",

"Thursday","Friday","Saturday");

var monthNames = new Array(

"January","February","March","April","May","June","July",

"August","September","October","November","December");

var now = new Date();

document.title(now.getDate() + " " + monthNames[now.getMonth()] + ", " + now.getFullYear());

var docTitle = document.title;

</script>

</head>

<body>

demo

</body>

</html>
Copy linkTweet thisAlerts:
@NogDogDec 30.2019 — Seems to me like it might make more sense to do that on the server side if possible -- especially if the intent is for search engines to pick it up?
Copy linkTweet thisAlerts:
@HarshShahApr 07.2020 — Heyy Shobha,

Try this

document.title=new Date();

You can also keep most of your old script, and change the part with document.write( stuff ); to document.title = stuff;
×

Success!

Help @shobha spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.27,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...