0
votes
0answers
5 views

Timer Thread Method not executing properly

I have a method that refreshes a grid view, I need to run this method on a page every 60 seconds. To do so I have implemented the following timer thread: var timer = new System.Threading.Timer( ...
0
votes
1answer
63 views

Programmatically (C#) set date field to blank in 2010

I have tried setting my date field to an empty string ("") and setting it to "01/01/0001". Both returned the error "String is not formatted as date time". I have several thousand items across a few ...
0
votes
1answer
97 views

SharePoint adds +1 to time when I set it

I have an issue with SharePoint date time field. Basically I have a date time field, and this field contains for example 19/12/2014 11:30:00. I would like to get this date and remove the time part, ...
1
vote
1answer
235 views

Converting date from utc to regional setting (cultural info) of the site

I have a question, basically i have a date time which is by default in UTC, how do i programmatically convert it to a correct date time in regional settings of the site collection / or user?
2
votes
2answers
115 views

Getting latest datetime from a splist

I have sharepoint list with data and one of the columns contains date ... how can i programmatically retrieve the latest date, the field is a Date And Time type?
0
votes
1answer
170 views

Want my column display minutes and want it to sum in hours

I have an issue again... I create list from csvfile. I convert string with date into DateTime type like this: string[] formattedDates = { "dd.MM.yyyy HH:mm:ss", "mm:ss", "HH:mm:ss", "dd.MM.yyyy", ...
2
votes
1answer
298 views

Why is default ScheduledItem StartDate a 'weird' value?

If you create a new ScheduledItem object and look at the StartDate - it's 1/1/1990 - why? This has just caught me out when trying to evaluate whether the dates have been set or whether they're, what I ...
1
vote
2answers
963 views

How to set date field to Today's Date in Wss 3.0 Custom list form programatically

How can i pre-populate newitem.aspx form with today's date. When user adds new item i want to prepopulate date field with todays date. <SharePoint:DateTimeControl ID="dtcDateofInsp" ...
3
votes
1answer
414 views

Set a date/lookup in ListInstance elements.xml

I have two lists. The first one has customers and the second one has Orders. Now i want to add some (test) data in the elements.xml of the listinstances. For customers this works without a problem ...
12
votes
2answers
13k views

Safest way to get a date from Sharepoint into a C# datetime field, using object model?

If I have a Sharepoint list item with a date field. How can I get the field value populated into a c# datetime object? For example: DateTime validfrom = Convert.ToDateTime(item["validfrom"]); ...