37

Since your "today" variable is a JavaScript date object, you can get the string representation by calling the toISOString() method. ...$filter=StartDate ge datetime'" + today.toISOString() + "' and ...


17

I answered the question here (not exactly a duplicate, since that was in regards to the Search REST API, and I happened to give an answer for basic REST). Here is how you filter dates in REST: $filter=StartDate ge datetime'2014-01-01T00%3a00%3a00' This filters for items created after 01-Jan-2014, 00:00:00. So to filter between two date ranges, simply add ...


14

ASP.NET AJAX (which is a part of SharePoint - MicrosoftAjax.js) extends the JavaScript Date object with a formatting function that closely mimics the DateTime.ToString method So, in your case the format string should be as follows: dd MMM yyyy, hh:ss var modified = item.get_item("Modified"); var fmtModified = modified.format('dd MMM yyyy, hh:ss'); For a ...


12

You need to format the date like this: Server Site string date = SPUtility.CreateISO8601DateTimeFromSystemDateTime(inputDate); Sample for your case: inputDate = new DateTime(2016,04,18); string date = SPUtility.CreateISO8601DateTimeFromSystemDateTime(inputDate); Client Side (client object model) string date = inputDate.ToString("yyyy-MM-ddTHH:mm:ssZ");...


12

Try the following formula =TEXT(Created-Closed,"h") [Output] In case you need to show the exactly Hours and minutes, try this =TEXT(Created-Closed,"hh:mm") [Output] Regarding Days and Hours and Minutes, try the below one =DATEDIF(Created,Closed,"d") &" days .."& TEXT(Created-Closed,"hh:mm") [Output]


10

You could utilize Regional Settings REST endpoint: /_api/web/RegionalSettings/TimeZone to retrieve SharePoint Time Zone settings and then get time for that time zone: function getSPCurrentTime(webUrl) { return $.ajax({ url: webUrl + "/_api/web/RegionalSettings/TimeZone", method: "GET", headers: { "Accept": "application/json; ...


10

Date columns are essentially numbers starting at 30/12/1899 So besides adding one day, you have to display it as a date again (when using it in a Calculated Column datatype=Text) =TEXT( [Due Date]+1 , "dd/mm/yyyy" ) Or set the datatype of the Calculated Column to Date =[Due Date]+1 Adding one day correctly counts the new date =TEXT(DATE(2015,12,...


10

Modify your CAML Query to <Value IncludeTimeValue='TRUE' Type='DateTime' StorageTZ='TRUE'>2018-06-28T07:07:09Z</Value> Here, we have added the StorageTZ=TRUE attribute which tells SharePoint to do the comparison using the native storage time zone (UTC time) of the field value since all time values of date time fields are stored using UTC time.


9

Date and time OData functions: day() month() year() hour() minute() second() does not seem to work with SharePoint 2013 REST Service Error: The query is not valid But you could consider the following approaches. Option 1 Utilize SharePoint 2010 REST endpoint: /_vti_bin/listdata.svc/ListName?$filter=month(<DateColumn>) eq <MonthNumber> ...


8

I tried logging the date string values before executing the creation of the listitem in the "Project Scheduling" calendar but the workflow would error without logging. Then I removed the listitem creation part and the logging worked. It was there that I noticed that the date values were set to 1/1/0001 12:00:00 AM. I found the same problem on Cliff ...


7

The point is that formula expression is usually language dependent. For example, is site locate is set to 1033 (English - United States), then the formula you have provided in the question is absolutely correct: Syntax: TEXT(value,format_text) Source But let's say the site locate is set to 1049 (Russia), in that case the proper syntax would be: ТЕКСТ(...


7

The formula for calculating hours between two times is =TEXT([Column2]-[Column1],"h")


6

Try item["Modified"] = null; That should make the Date/Time field empty.


6

This is a known issue with Workflow Manager: If the permissions of a workflow scope are set to BUILTIN\Administrators, Client Applications must run using elevated permissions If the permissions of a workflow scope are set to BUILTIN\Administrators, which is the default setting, an exception similar to the following is thrown if the client application is ...


6

I've found that in Sharepoint Designer 2013 there's an option to select today. If you click the ellipses next to the value option, there's a selector for current date.


6

Yes you should get the site's TimeZone first and then convert your DateTime accordingly. function getTimeZoneAndServerDateTime() { var context = SP.ClientContext.get_current(); var web = context.get_web(); var timeZone = web.get_regionalSettings().get_timeZone(); context.load(timeZone); context.executeQueryAsync( function ...


6

It's fairly straight forward I would say. // First get your field using the title from your list $field = $list.Fields["FieldTitle"] // Alternativly you could use $list.Fields.GetFieldByInternalName("InternalFieldName") $field.DisplayFormat = "DateOnly" $field.Update() I hope this helps.


5

You can make a calculated column, formatted as Date and Time, with a formula like this: =DATE(YEAR([Start Date])+1,MONTH([Start Date]),DAY([Start Date]))


5

For full explanation see Dealing with Multiple Time Zones in SharePoint 2010 var user = SPContext.Current.Web.CurrentUser; // Always perform a Null-Check on SPUser.RegionalSettings if (user.RegionalSettings != null) { return user.RegionalSettings.TimeZone.UTCToLocalTime(listDateUtc); } else { // User didn't set a time zone, so use the one from the ...


5

I think this still holds true, http://blog.brianfarnhill.com/2008/10/showing-the-date-modified-date-on-a-page-layout <PublishingWebControls:LastModifiedIndicator runat="server" /> or <SharePoint:FieldValue FieldName="Modified" runat="server" id="modified" ControlMode="display" />


5

What a fun problem! For column LastMonday: =IF(WEEKDAY([Created])=1,DATE(YEAR([Created]),MONTH([Created]),DAY([Created])-6),DATE(YEAR([Created]),MONTH([Created]),DAY([Created])-WEEKDAY([Created])+2)) For column NextSunday: =IF(WEEKDAY([Created])=1,[Created],DATE(YEAR([Created]),MONTH([Created]),DAY([Created])-WEEKDAY([Created])+8)) You can do this as a ...


5

Try the following format YYYY/MM/DD Here is an example. myManageProperty=2014/01/02..2014/02/17 Ref: Problem in KQL with date times and client object model in Sharepoint


5

This article explains REST filtering based on date, http://itblog.wolthaus.net/2011/12/rest-filter-datetime/. You'd want to pass in a date in YYYY-MM-DD format.


5

In case you use JavaScript: First of all you need a reference to SP.dateTimeUtil.js: <script type="text/javascript" src="/_layouts/15/SP.dateTimeUtil.js"></script> This file contains a JavaScript function called getRelativeDateTimeString() accepting four parameters: Date ISO8601 IncludeTime CalendarType AdjustToServersNowTime You call the ...


5

If I understood you correct you want to set your date as yesterday, two days ago, etc. and not just to see actual date 18.08.2015. If so, there is choice field when creating date column, name of that field is Display Format. you should choose Friendly option, default option is Standard. I do apologize if you meant something different to ask.


5

This is possible for ArticleStartDate on O365 but involves modifying the SchemaXml (which isn't the nicest solution I appreciate, but needs must). Note that the below code snippet is in C# but obviously PowerShell is still using CSOM so should be easy to convert private void DefaultArticleDate(ClientContext clientContext) { string todaysDate = "=[Today]";...


5

I wouldn't do this with workflow, I would do this in a PowerShell script that runs on the server, set it up in a Task Scheduler, and let it run every Monday. The script would kick off the workflow that you want, or alternatively use the PowerShell script to compile and send the email instead of the workflow.


5

Date calculations go from 23:59 to 00:00 So =TEXT( Time(16,35,0)+Time(14,0,0) , "hh:mm" ) will produce 06:35 Let's take different values to examine edge-cases What should 16:35 + 14:35 do? To get to 30:70 you have to count hours and minutes But I can't imagine any use case for that You probably want the Duration result: 31:10 16:35 + 14:35 = 31:10 ...


4

It sounds like the issue is within your workflow "Add or Change Lookup" settings. When you add the Lookup, make sure you choose >> Current Item >> Column/Field Name >>"RETURN FIELD AS" -Here you can select "SHORT DATE" if you want the time to be removed.


Only top voted, non community-wiki answers of a minimum length are eligible