Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8

Thread: ASP Calendar

  1. #1
    Regular Coder QBall777's Avatar
    Join Date
    Mar 2005
    Location
    uk
    Posts
    156
    Thanks
    5
    Thanked 1 Time in 1 Post

    ASP Calendar

    Hi

    I download an asp calendar for my local golf club, at first I had trouble getting the correct days of the start of each month ie

    Jan 1st is on a Monday Feb 1st is on a Thursday

    I corrected this problem by using this code <% Session.LCID = 2057 %>

    The problem I am facing now is if I enter an event on 2nd March 07 the event is being displayed on 3rd Feb 07

    As you can see the date format is being switched, I have looked at the code but I still can not figure out where to re format it.

    If I zip the files up would someone be willing to have a look at this for me.

    Many thanks

  • #2
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,065
    Thanks
    4
    Thanked 8 Times in 8 Posts
    Before you save the date of the event in the database do this

    Code:
    Response.Write "TheDateReturnedFromYourCalendar" 
    Response.End
    is the date returned in the correct format?
    If not make sure the LCID is on the page that saves the data in the db.
    If it wasn't on there, add it and then try again,

  • #3
    Regular Coder QBall777's Avatar
    Join Date
    Mar 2005
    Location
    uk
    Posts
    156
    Thanks
    5
    Thanked 1 Time in 1 Post
    Hi

    When you add an event the date is formated the correct way.
    The LCID is present on every page including the page that saves the data.

  • #4
    Senior Coder
    Join Date
    Nov 2002
    Location
    North-East, UK
    Posts
    1,265
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You can construct your own date so that you know that you are submitting it in the correct format e.g (uk or us).

    Sometimes to aviod confusion you can use a global date format such as
    yyyy-m-d


    Also, datebases have format functions to make sure that you are outputting the date in the correct format.
    e.g. Format(dateField,'dd/mm/yyyy')

  • #5
    Regular Coder QBall777's Avatar
    Join Date
    Mar 2005
    Location
    uk
    Posts
    156
    Thanks
    5
    Thanked 1 Time in 1 Post

    Unhappy

    I tried formating the database field with your example but it made no difference.

  • #6
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,065
    Thanks
    4
    Thanked 8 Times in 8 Posts
    Did you do a response.write after you clicked on the date was it in the correct format?

  • #7
    Regular Coder QBall777's Avatar
    Join Date
    Mar 2005
    Location
    uk
    Posts
    156
    Thanks
    5
    Thanked 1 Time in 1 Post
    Hi


    I added an event in the admin section and then dowloaded the db the date had been switched to US format in the database, so it is changing format before it reaches the db, I think.
    Last edited by QBall777; 02-27-2007 at 08:45 AM.

  • #8
    Regular Coder QBall777's Avatar
    Join Date
    Mar 2005
    Location
    uk
    Posts
    156
    Thanks
    5
    Thanked 1 Time in 1 Post
    If I add this in the admin section I get the correct LCID <%= getLocale() %> 2057


  •  

    Posting Permissions

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