Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Get Created Date of Current Web using jsom in SharePoint
WhatsApp
Shantha Kumar T
May 04
2016
1.7
k
0
0
//Author: Shantha Kumar T
//Property used: SP.Web.created (sp.js)
//Supports SharePoint 2010 + and SharePoint Online
function
getWebCreationDate() {
var
clientContext =
new
SP.ClientContext();
oWeb = clientContext.get_web();
clientContext.load(oWeb);
clientContext.executeQueryAsync(
Function.createDelegate(
this
,
function
() {
//The below line returns the created date of website in current locale format
alert(oWeb.get_created());
}),
Function.createDelegate(
this
,
function
(sender, args) {
alert(
'Request failed. '
+ args.get_message() +
'\n'
+ args.get_stackTrace());
}));
}
function
injectMethod() {
getWebCreationDate();
}
ExecuteOrDelayUntilScriptLoaded(injectMethod,
"sp.js"
);
JSOM
SP.JS
SharePoint
Up Next
Get Created Date of Current Web using jsom in SharePoint