Results 1 to 4 of 4

Thread: [RESOLVED]Date format

  1. #1

    Thread Starter
    Lively Member George-LSA's Avatar
    Join Date
    May 2004
    Location
    Sydney, Australia
    Posts
    126

    Question [RESOLVED]Date format

    hey,

    in my asp page the date format is automatically american format...so MM/DD/YYYY.....i need it to be australian format which is DD/MM/YYYY

    wat do i use to do this type of function???

    my code is below
    could you please be specific on where i should place it...

    VB Code:
    1. <!--==Visual InterDev Generated - startspan==-->
    2. <!--METADATA TYPE="TypeLib" NAME="Lilly Software 6x Data Management Library 1.0" UUID="{1050EBB1-9441-11D3-8A63-00104BF1915F}" VERSION="1.0"-->
    3. <!--METADATA TYPE="TypeLib" NAME="Lilly Software Data Management Library 1.0" UUID="{74C704A1-0AB3-11D3-B9C3-BB23FD298935}" VERSION="1.0"-->
    4. <!--METADATA TYPE="TypeLib" NAME="VMFG Global Business Logic Library" UUID="{4A0EE891-6142-11D3-8A01-00104BF1915F}" VERSION="1.0"-->
    5. <!--METADATA TYPE="TypeLib" NAME="VMFG Inventory Business Logic Library" UUID="{37F3C561-6A0C-11D3-8A0A-00104BF1915F}" VERSION="1.0"-->
    6. <!--METADATA TYPE="TypeLib" NAME="VMFG Sales Business Logic Library" UUID="{49431731-80F5-11D3-8A36-00104BF1915F}" VERSION="1.0"-->
    7. <!--METADATA TYPE="TypeLib" NAME="VMFG Financials Business Logic Library" UUID="{43B56231-886C-11D3-8A47-00104BF1915F}" VERSION="1.0"-->
    8. <!--METADATA TYPE="TypeLib" NAME="VMFG Shopfloor Business Logic Library" UUID="{E5B8B671-6D0F-11D3-8A0F-00104BF1915F}" VERSION="1.0"-->
    9. <!--METADATA TYPE="TypeLib" NAME="Vweb Sales Business Logic Library 1.0" UUID="{221A4931-A4FC-11D3-8045-00104BF133E6}" VERSION="1.0"-->
    10. <!--METADATA TYPE="TypeLib" NAME="Vweb Shared Business Logic Library 1.0" UUID="{BE3D7F3B-1304-49ED-A63F-C2DCBBC7776F}" VERSION="1.0"-->
    11. <!--METADATA TYPE="TypeLib" NAME="Vweb Inventory Business Logic Library 1.0" UUID="{F6CD3036-9EB4-4529-9703-9FBC45E29BFB}" VERSION="1.0"-->
    12. <!--METADATA TYPE="TypeLib" NAME="Microsoft ActiveX Data Objects 2.6 Library" UUID="{00000206-0000-0010-8000-00AA006D2EA4}" VERSION="2.6"-->
    13. <!--METADATA TYPE="TypeLib" NAME="Microsoft CDO for Windows 2000 Library" UUID="{CD000000-8B95-11D1-82DB-00C04FB1625D}" VERSION="1.0"-->
    14. <!--METADATA TYPE="TypeLib" NAME="Microsoft CDO for NTS 1.2 Library" UUID="{0E064ADD-9D99-11D0-ABE5-00AA0064D470}" VERSION="1.2"-->
    15. <!--==Visual InterDev Generated - endspan==-->
    16. <!--This object is used in tracking, don't touch'-->
    17. <OBJECT RUNAT=SERVER  SCOPE=Session ID = bc PROGID ="MSWC.BrowserType"></OBJECT>
    18.  
    19. <!--#include file="Shared/init.asp"-->
    20. <SCRIPT LANGUAGE=VBScript RUNAT=Server>
    21. 'You can add special event handlers in this file that will get run automatically when
    22. 'special Active Server Pages events occur. To create these handlers, just create a
    23. 'subroutine with a name from the list below that corresponds to the event you want to
    24. 'use. For example, to create an event handler for Session_OnStart, you would put the
    25. 'following code into this file (without the comments):
    26.  
    27. 'Sub Session_OnStart
    28. '**Put your code here **
    29. 'End Sub
    30.  
    31. 'EventName              Description
    32. 'Session_OnStart        Runs the first time a user runs any page in your application
    33. 'Session_OnEnd          Runs when a user's session times out or quits your application
    34. 'Application_OnStart    Runs once when the first page of your application is run for the first time by any user
    35.  
    36. 'Application_OnEnd      Runs once when the web server shuts down
    37.  
    38.  
    39. Sub Application_OnStart
    40.     Application("bDatabaseOpened") = False
    41.     ' Client Login
    42.     ' Determines whether business objects will load will be run by the client (web server) or
    43.     ' by an application server (MTS).
    44.     ' Set bVMfgClientLogin or bVWebClientLogin = True to run without MTS
    45.     ' Set bVMfgClientLogin or bVWebClientLogin  = False to run with MTS
    46.     Application("bVMFGClientLogin") = True
    47.     Application("bVWebClientLogin") = True
    48.     'Database related variables
    49.     Application("VMfgDb") = Null
    50.     Application("VWebDb") = Null
    51.    
    52.     Application("VWEB_Instance") = "VWEB"
    53.     Application("VMFG_Instance") = "VMFG"
    54.     Application("VM_UserID") = "SYSADM"
    55.     Application("VM_Password") = "SYSADM"
    56.     Application("VWEB_UserID") = "VWEB"
    57.     Application("VWEB_Password") = "VWEB"
    58.    
    59.     'Product Categories variables
    60.     Application("ProductList") = ""
    61.     Application("ProductDescriptions") = ""
    62.    
    63.     'Open the Database Connections
    64.     DbmsOpen()
    65.    
    66.    
    67.     'Create the list of Product Categories
    68.     Load_ProductCategories()
    69.    
    70.     'version control
    71.     Application("SiteVersion") = false
    72.    
    73.     'Load the variables via the database
    74.     Load_ApplicationVariables()
    75.     Application("LoadCounter") = 0
    76. End Sub
    77.  
    78.  
    79. Sub Session_OnStart
    80.    
    81.     'Variable to determine how many times to try and connect to the database
    82.     Session("CurrentRetryAttempts") = 0
    83.  
    84.     CheckSiteVer()
    85.     'Used to determine IP name under which vb2c is installed.
    86.     Session("HOST") = Request.ServerVariables("HTTP_HOST")
    87.     'Load all the session variables from here.
    88.     Load_Session()
    89.    
    90.     'Check the Browser
    91.     Browser_Detect()
    92.  
    93.    
    94. End Sub
    95.  
    96. Sub Session_OnEnd
    97.     'Logout a user if he/she has forgotten to logout.
    98.     Login_EndSession()
    99.     Session.Abandon()
    100. End Sub
    101.  
    102. Sub Application_OnEnd
    103.     DbmsClose()
    104. End Sub
    105. </SCRIPT>


    Thank you

    Regards,

    George
    Last edited by George-LSA; Aug 7th, 2004 at 10:07 PM.
    Kind Regards,

    George S
    LSA Australia Pty Limited
    www.lsaa.com.au

    -----------------------------------------

    CCNA and CCNP certified
    Visual Basic 6 Developer
    -----------------------------------------
    Dont forget to Rate a post that Helped you
    And mark a post [RESOLVED] when your problem has been resolved.

  2. #2
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877
    Unlike VB, there is no Date Formatting function in ASP. You could us LCID or do it manually. I do it manually.. e.g

    VB Code:
    1. myDate = now
    2.  
    3.         dd=day(myDate)
    4.     mm=month(myDate)
    5.     'mn=MonthName(mm)
    6.     yy=year(myDate)
    7.  
    8.  
    9.     response.write mm & "/" & dd & "/" & yy
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

  3. #3

    Thread Starter
    Lively Member George-LSA's Avatar
    Join Date
    May 2004
    Location
    Sydney, Australia
    Posts
    126

    Resolved

    hey danial

    i figured out how to do it so much easier than u did

    check this out

    VB Code:
    1. Session.LCID = 3016

    each country has a different 4 digit representation which determines the date format.

    i placed it in 'Sub Session_OnStart' since that loads when every session is started or in easier terms when a user opens the webpage
    Kind Regards,

    George S
    LSA Australia Pty Limited
    www.lsaa.com.au

    -----------------------------------------

    CCNA and CCNP certified
    Visual Basic 6 Developer
    -----------------------------------------
    Dont forget to Rate a post that Helped you
    And mark a post [RESOLVED] when your problem has been resolved.

  4. #4
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877

    Re: Resolved

    Originally posted by George-LSA
    hey danial

    i figured out how to do it so much easier than u did

    check this out

    VB Code:
    1. Session.LCID = 3016

    each country has a different 4 digit representation which determines the date format.

    i placed it in 'Sub Session_OnStart' since that loads when every session is started or in easier terms when a user opens the webpage
    Originally posted by Danial
    You could us LCID or do it manually. I do it manually.. e.g

    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

Posting Permissions

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



Click Here to Expand Forum to Full Width