PC Review


Reply
 
 
=?Utf-8?B?SGFzc2Fu?=
Guest
Posts: n/a
 
      6th Sep 2007
Hi All,

How I can change the date type from
dd/mm/yyyy hh:mm:ss to [hh]:mm:ss

Thanks & Regards

Hassan
 
Reply With Quote
 
 
 
 
=?Utf-8?B?SGFsaW0=?=
Guest
Posts: n/a
 
      6th Sep 2007
For example:
sub test()
Yourdate = 01/12/2007 22:00:01
YourHour = Format(Yourdate,"hh:mm:ss")
msgbox Yourdate
End sub
--
Regards,

Halim



"Hassan" wrote:

> Hi All,
>
> How I can change the date type from
> dd/mm/yyyy hh:mm:ss to [hh]:mm:ss
>
> Thanks & Regards
>
> Hassan

 
Reply With Quote
 
Bill Renaud
Guest
Posts: n/a
 
      6th Sep 2007
I think it would be better to add a "Time" style to your workbook,
instead of re-defining the "Date" style. Changing the style would be
confusing to other users, if you forward the workbook to them.

To add a new style to your workbook (instructions for Excel 2000):

1. Choose the Style command from the Format menu.
2. Type in "Time" in the "Style name" combo box.
3. Uncheck all of the checkboxes except "Number".
4. Click the Add button.
5. Click the Modify button to display the Format Cells dialog box, then
choose "Time" in the Category list box, and one of the time formats in
the Type list box.
6. Click OK in the Format Cells dialog box.
7. Click Close or OK in the Style dialog box.

Use this "Time" style to format all of the cells you want. If you don't
have the style combo box displayed on your Formatting toolbar, add it by
using the Customize feature. (Microsoft started leaving the Style box
off of the toolbar with Excel 2000. I don't know if they have added it
back in more recent versions or not. Maybe Styles have even gone away in
the latest version!)
--
Regards,
Bill Renaud



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date type Variable - Type Mismatch mané_uk Microsoft Access Form Coding 5 8th Jul 2009 06:10 PM
Text type date change to date type date Chrissy Microsoft Access 2 28th Apr 2009 06:17 PM
how to convert date type to text type =?Utf-8?B?U3RlZmZlbg==?= Microsoft Excel Misc 3 17th Jul 2007 11:32 AM
Convert date type to text type Sirocco Microsoft Access Queries 8 3rd Dec 2004 03:21 AM
Operator is not valid for type 'DBNull' and type 'Date' Microsoft ASP .NET 7 9th Jun 2004 04:36 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:47 AM.