Results 1 to 5 of 5

Thread: date time picker problem

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2004
    Posts
    23

    date time picker problem

    Hi my date time picker control box displays information in this format, with the format property set to short

    4/1/04 which is the 1st April 2004 (American Standard)

    i wish to change it to the british Standard with the format as being 1/4/04 which be 1st of April 2004 again.

    I wish to change the 4/1/04 to 1/4/04
    Can anyone plz help ?

    Thanks

  2. #2
    Fanatic Member pvbangera's Avatar
    Join Date
    Sep 2001
    Location
    Mumbai, India
    Posts
    961
    Set ur DTP control's Format property to "Custom"

    Then set ur DTP control's CustomFormat property to "d/M/yy"

    Regards,

    Prakash

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Mar 2004
    Posts
    23
    Thanks dat worked..

    But now since ive converted the custom format to british style

    my custom format is like this 'dd/MM/yyyy'

    ive got 2 date time picker controls

    dtpick1
    and
    dtpick2

    i am using the function datediff but it doesnt seem to b picking up the date from the datetimepicker

    Dim WYS As Long = DateDiff(DateInterval.WeekOfYear, dtpick1, dtpick2)

    do i need to declare two variable as date and then store the date from the datetime picker controls in them n then use them in the datediff function ? i tried that one also but it didnt work

    i get error saying

    Argument 'Date1' cannot be converted to type 'Date'.


    Can anyone help plz ?

    regards

  4. #4
    Lively Member ayan's Avatar
    Join Date
    Jan 2004
    Posts
    112
    perhaps try the

    VB Code:
    1. Dim wys As Long = DateDiff(DateInterval.WeekOfYear, DateTimePicker1.Value, DateTimePicker2.Value)

    use the value of your dtps... hope this helps...

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Mar 2004
    Posts
    23
    Thanks dude

    this one too worked

    THanks

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