ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Convert now (current date and time) to a string ddmmyyyyhhnn. (https://www.excelbanter.com/excel-programming/419474-convert-now-current-date-time-string-ddmmyyyyhhnn.html)

David Langschied

Convert now (current date and time) to a string ddmmyyyyhhnn.
 
I have been looking through the threads here on converting the current time
to a string and it seems to look a lot more complicated that it should be. I
am not a VB programmer (though a play one on TV). I have done alot of other
programming and it is usually as smiple as:

dateaschar = string(now, "mmddyyyyhhnn")

I realize that I may have to do that date and time separately.



Mike

Convert now (current date and time) to a string ddmmyyyyhhnn.
 
Sub playOnTv()
dateaschar = Format(Now, "mmddyyyyhhnn")
MsgBox dateaschar
End Sub

"David Langschied" wrote:

I have been looking through the threads here on converting the current time
to a string and it seems to look a lot more complicated that it should be. I
am not a VB programmer (though a play one on TV). I have done alot of other
programming and it is usually as smiple as:

dateaschar = string(now, "mmddyyyyhhnn")

I realize that I may have to do that date and time separately.



David Langschied

Convert now (current date and time) to a string ddmmyyyyhhnn.
 


"Mike" wrote:

Sub playOnTv()
dateaschar = Format(Now, "mmddyyyyhhnn")
MsgBox dateaschar
End Sub

"David Langschied" wrote:

I have been looking through the threads here on converting the current time
to a string and it seems to look a lot more complicated that it should be. I
am not a VB programmer (though a play one on TV). I have done alot of other
programming and it is usually as smiple as:

dateaschar = string(now, "mmddyyyyhhnn")

I realize that I may have to do that date and time separately.




All times are GMT +1. The time now is 07:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com