[Gambas-user] Date to string MMddyyyyHHmmss

Bruce Bruen bbruen at ...2308...
Tue Feb 7 11:39:42 CET 2012


On Tue, 2012-02-07 at 00:24 -0800, abbat wrote:
> How to get a Date without any separators, splash and dots?
> 
> In VB.NET  I can get it by:
> Dim T = Now.ToString("MMddyyyyHHmmss")
> 
> I get "02062012192533"
> 
> In "HOW TO" I could not find such exemple.
> 
> Thanks
abbat,
The answers to many of you questions are in the gambas help files.
You could perhaps avail yourself of these before posting such basic
questions.
The first thing I would suggest is to try and stop thinking in terms of
VB.NET!  Gambas is not VB.NET nor is it a clone of VB.NET, please try
and think in gambas terms and not in VB.NET terms.  I say this because
a) we have all gone through the learning curve for gambas, again it's
all in the help files, and b) some of us can get a bit upset by the
constant reference to "this works in VB.NET, why not in gambas"
questions.
I will say one more thing, the gambas help files are very correct and
they are also VERY SUCCINCT. In other words, you need to read every word
on a help page and grasp its' meaning.
For example, if I look up the Now keyword in the language index I see
that it says that "dTime = Now [ ( ) ] AS Date" and it "Returns the
current date and time." On that page there is also a link to the "Date &
Time Functions". On that page I don't see anything that "obviously"
solves your problem, BUT! at the end of the page is a link to "Intrinsic
Functions" and behold, on that page is a link to "Format$" which by it's
description ... "Format a number or a date." looks like exactly the the
thing you are after.

Please don't take this the wrong way.  I just think you need to spend
more time reading the help pages (as we all have done).

cheers
Bruce





More information about the User mailing list