Accessing Date and Time Values

Hi there.

I would like to display date and time on my web application.
Each label shows one info:
lblMonth ---> displays current Month (e.g. Jan,Feb,Mar and so on)
lblDayNo ---> displays current DayNo (e.g. 1,2,3 and so on)
lblDay ---> displays current Day (e.g. Monday,Tuesday and so on)
lblTime ---> displays current Time where the time is updated every minutes
My code goes like this:
Dim strMonth As New Date()
Dim strDayNo As New Date()
Dim strDay As New Date()
Dim strtime As New DateTime()
lblMonth.Text = strMonth.Month.ToString
lblDayNo.Text = strDayNo.Day.ToString
lblDay.Text = strDay.DayOfWeek.ToString
lblTime.Text = strtime.TimeOfDay.ToString
I couldn't get the results I wish for.
Any idea?
Thanks.
0
vasan80
1/4/2004 7:50:21 AM
asp.net.visual-basic.net 3721 articles. 0 followers. Follow

2 Replies
382 Views

Similar Articles

[PageSpeed] 5

Hi,

hopefully this sample will help you to the start:

Dim dt As DateTime = DateTime.Now
lblMonth.Text = dt.ToString("MMM")
lblDayNo.Text = dt.ToString("dd")
lblDay.Text = dt.ToString("dddd")
lblTime.Text = dt.ToString("hh:mm")

consult string formatting in the SDK documentation for exact details.
Thanks,

Teemu Keiski
Finland, EU
0
joteke
1/4/2004 9:26:39 AM
It works now.

Thanks a lot.
0
vasan80
1/4/2004 11:16:06 AM
Reply:

Similar Artilces:

Visual Basic.NET or Visual Studio.NET?
OK, this has probably been asked before... I'm a student looking to cut my costs, and I can do this by just purchasing Visual Basic.NET as opposed to the fully-fledged Visual Studio.NET application. Of course, I'll only be able to program in VB, but that's fine with me. I wanted to know if all of the ASP.NET specific options are available, such as using a WYSIWYG editor? I'd also like to know if VB.NET has IntelliSense, or that's a specific option only available to Visual Studio.NET users. Thanks in advance. I'd have to believe that VB.Net has intellisense. What is the price d...

Visual Studio .Net? Visual Basic .Net?
Okay, I admit it -- I know nothing about .Net. I'm a Visual Basic and ASP developer. DotNetNuke is my first tentative step into the whole ".Net Thing", and I'm looking for some advice... What do I really need to be able to make some modifications, or new modules for DotNetNuke? Do I need the full, THOUSAND DOLLAR Visual Studio .Net 2003 package, or can I get away with the HUNDRED DOLLAR Visual Basic .Net Standard package?Chameleon Systems, Inc. You can use webmatrix, available here for free. One of the drawbacks of webmatrix however is that it does not support code-be...

Visual Basic.NET or Visual Studio.NET? #2
I am currently using the Web Matrix to develop ASP.NET applications, but I am keep to upgrade to VS.NET. However, I can't justify spending $1,000 at the moment. I then found the MUCH cheaper "Visual Basic .NET 2003 Standard Edition" which is only $100. I have very little C# knowledge, and use Basic almost all the time. Would this be a good tool to use for web development? Does it support all the code behind stuff that VS users love so much? Thanks!! I use "VB.NET Standard Edition" and I'm happy with it. It has exactly the same features as Visual Studio.NET. Th...

Visual Basic .NET 2003 vs Visual Studio .NET 2003
Hi, If im going to be coding my ASP.NET in just VB.NET then would I be able to go for the cheaper option of buying Visual Basic .NET 2003 ?? - Carl S Yes.Starting with ASP.NET 2.0? Look at:Programming Microsoft Web Forms My Blog Are there any limitations if I was doing my ASP.NET with VB.NET in Visual Basic .NET 2003 than if I was using the full Visual Studio .NET 2003 ?? Or are the only advantages of Visual Studio .NET 2003 in that it supports more programming languages ?? - Carl S You should check the MS Web site, but I believe that, given an edition (Standard, Professional...

ADO.NET Programming in Visual Basic .NET
Has anyone read "ADO.NET Programming in Visual Basic .NET, Second Edition" by Steve Holzner (Author), Bob Howell (Author)? I am trying to working on a project and there are a few things that I need to tie up quickly in my web forms. Is this book a good one? karls------------------------------------'Old and wrinkled is not what I expected to become when I grew up!'...

Converting Visual Basic 6 to Visual Basic .NET
Hi, I found this program that would get the mac address of a computer given its IP. I converted it into vb.net and it gave 2 errors. It said that I couldn't use "any" in declarations, so I found out what variable it was tryign to pass and changed the any to that data type. Now, the program will start in vb.net... but when I click the button, it returns the wrong mac address, while the one in vb6 returned the correct one.All you have to do is add 2 textboxes to the form and 1 button, dont change their names.::::::::::VB6 CODE::::::::::Option ExplicitPrivate Const NO_ERROR = 0Private Declare F...

C# Visual Basic.NET JScript.NET what should I choose ?
I'm just a beginner with programing ASP.NET web sistes. Unfortunatelly I don't know any of the languages supported by ASP. (By the time I programmed in DELPHI and SQL) So I should start to learn one of the languages. Could somebody help me to choose the language I should use ? Which and why ? Thanks in advance, Gonzi Use C# or VB.NET, which ever you are comfortable with. Go here to see sample of both in use http://samples.gotdotnet.com/quickstart/aspplus Ultimately, once you get more advanced, you'll really want to become comfortable with both languages. I ...

Error with Access in Visual Basic.Net
I am novice in Visual Studio (Asp.Net). I make a MSDN Tutorial of ASP.NET and use an Access Database (midis.mdb) This database is the same used in my site (http://sml.prolatin.com) maked with Classic ASP and never I had problem in the server or with IIS to run the database but when I try to run the aplication in Visual Studio the error is: "The Microsoft Jet database engine cannot open the file 'C:\Inetpub\wwwroot\WebMidi\midis.mdb'. It is already opened exclusively by another user, or you need permission to view its data." And the database are not open by another user.....(V...

Can I go from VS .NET 2003 to Visual Basic .NET 2003?
Hi, I just developed a commercial application using the trial version of Visual Studio .NET 2003.  My trial is about to expire.  I was hoping .NET 2.0 would be released by now, but that is obviously months away so I'm wondering if I could save a few hundred bucks by buying Visual Basic .NET 2003(around $110 i think) instead of having to buy Visual Studio .NET 2003, which I believe is up around $600 or so.   All my code is Visual Basic, so that's why I'm thinking that's all I need.  And it's mostly web development that I do if that matters.  T...

Visual C#.Net vs Visual Studio.Net
I have read in other posts a lot of people recommending Visual Studio.Net over the Web Matrix. My query is: why is there a £700 difference between VS.Net and Visual C#.Net? As a c# developer, I won't need any VB functionality. I also don't require Visual Source Safe, as projects are generally small and manageable. What features are lacking in Visual c#.net that justifies the price difference? Does it have Intellisense / Dubuggers / Compilers? These are the features that would make me pay for it instead of continuing with WM, but I need to know if tehre is serious functionality missin...

What are the diff. visual basic 6 and vb.net ? How to convert the VB6 project to vb.net proj ?
What are the diff. visual basic 6 and vb.net ? How to convert the VB6 project to vb.net proj ? with code and interface too. There are entire forums dedicated to the differences between the two, and to convert your projects you should try the upgrade wizard in Visual Studio....

Free Book
followup to grc.techtalk Free Book - Upgrading Microsoft Visual Basic 6.0 to Microsoft Visual Basic .NET http://msdn.microsoft.com/vbrun/staythepath/additionalresources/upgradingvb6/ ----------------------------------------------------------- Quote ----------------------------------------------------------- Upgrading Microsoft Visual Basic 6.0 to Microsoft Visual Basic .NET is is the complete technical guide to upgrading Visual Basic 6 applications to Visual Basic .NET, covering all upgrade topics from APIs to ZOrders. It shows how to fix upgrade issues with forms, language, data...

Can I install Visual Basic 6 on my machine which has VS.NET 2003 & VS.NET 2005?
I may have a need to use Visual Basic 6 for a legacy project in the near future.  I was wondering if I can install VB6 on my machine which already has VS.NET 2003 & VS.NET 2005 installed on it? I did not know if doing so would cause issues or not so thought I would ask before just leaping and doing.   Ira Richard Smith At one time i had to install Visual Basic 6 on my machine with VS.NET 2003 and had "NO" issues. I would suggest take a backup of your machine or a restore point before you proceed. Please post your experience. I am sure some one would appreci...

Net:Net:Net::LDAP::FAQ
------_=_NextPart_001_01C6429F.D89AA417 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello, Net::LDAP Net::LDAPS Is there a possible to LDAP bind with an encrypted (SHA, SSHA, CRYPT, ....) password? I don't like to write the secret password to the perl file. Best regards Barbara Wilbert ------_=_NextPart_001_01C6429F.D89AA417-- Wilbert Barbara (CI/OSI) * wrote: > Hello, > > Net::LDAP > Net::LDAPS > > Is there a possible to LDAP bind with an encrypted (SHA, SSHA, CRYPT, > ......

Visual Studio .NET vs Visual Studio .NET 2002 or 2003?
As an admin, I'm working to determing what systems I need to update with the update on MS08-017, particularly with respect to Visual Studio .NET 2002 and 2003. I've got quite a few systems that appear to have Visual Studio .NET, no 2002 or 2003 mentioned when I view what's there in Add/Remove Programs. Is there a definitive way to determine if I have a 2002 or 2003 version?   sandy_wood:Is there a definitive way to determine if I have a 2002 or 2003 version? In add/remove programs it would indicate it VS2003 as Visual Studio 2003. Alternatively launch the applicatio...

Web resources about - Accessing Date and Time Values - asp.net.visual-basic.net

Highest Percentage Of Opera Mini Users Accessing Facebook? Macau
If you were asked to guess which country had the highest percentage of users of Opera mobile Web browser Opera Mini users accessing Facebook ...

International Users Accessing Facebook Places Through US VPN Accounts
By using a virtual private network (VPN) hosted in the United States, Facebook users from around the world are accessing Facebook Places. The ...

What are some alternatives to Yodlee for accessing bank information?
Clay Loveless , Founder, Jexy. Co-founder, Mashery. Founder, Jexy. Co-founder, Mashery.

Cloud Console - Accessing files in cloud storage for iPad on the iTunes App Store
Get Cloud Console - Accessing files in cloud storage on the App Store. See screenshots and ratings, and read customer reviews.

Meryl Streep On Accessing The Characters Within - YouTube
Meryl Streep talks about the importance of an actors work representing their ability. CONNECT WITH AFI: http://facebook.com/AmericanFilmInstitute ...

Student pleads guilty to accessing records about Frances Abbott design scholarship
The Sydney student who leaked information about a fashion school scholarship controversially awarded to the daughter of the Prime Minister has ...

Accessing a headline opinion
Accessing a headline opinion

Sharp increase in authorities accessing private data
Australian law enforcement and government agencies have sharply increased their access without warrant to vast quantities of private telephone ...

Former librarian charged with accessing student records of Frances Abbott
A former part-time librarian at a Sydney design school has been charged after she allegedly accessed student records of Prime Minister Tony Abbott's ...

Frances Abbott scholarship: Sydney woman pleads guilty to accessing Whitehouse Institute records on PM's ...
A Sydney woman who leaked the student records of Tony Abbott's daughter pleads guilty. A Sydney woman who leaked the student records of Prime ...

Resources last updated: 12/9/2015 8:51:17 AM