Results 1 to 2 of 2

Thread: Uploading Excel to SharePoint Date Format Changes

  1. #1
    Addicted Member
    Join Date
    Apr 07
    Posts
    196

    Uploading Excel to SharePoint Date Format Changes

    Hi


    I am uploading Excel files created on a server to a sharepoint, using bat file, and when I do this a date field keeps changing date formats from dd/mm/yyyy to mm/dd/yyyy, onm server date format is dd/mm/yyyy. The sharepoint is a corporate installation and we do not have access to the server or settings. The only front-end settings I can change is regional settings - to UK format -that I thought would do the trick.

    I changed it yesterday, uploaded a file and it seemed to retain the proper date format I want (dd/mm/yyyy) but now notice on another file on another site it is showing the mm/dd/yyyy format again.

    Rechecked the regional settings and all are still UK setting on that site.

    I don't know if there is an issue with the setting on this site as the other site appeared to work ok now.

    G

  2. #2
    PowerPoster
    Join Date
    Dec 04
    Posts
    18,526

    Re: Uploading Excel to SharePoint Date Format Changes

    i really like date in format dd/mmm/yyyy as it can not be ambiguous, the only solution i can suggest is to loop through all dates to find which format the date is in then convert all if required
    to confirm the date format find the first date where day is > 12, or if you know a value of a specific date within the file you can find the format of that (unless day and month are the same)
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •