|
| ||||||||||
| Tags: ascii, date, excel, system date, windows, xml format |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| ||||
| ||||
| Can I put the Actual Date in Excel or VBA?
__________________ Technology is a way of organizing the universe so that man doesn't have to experience it.-- Max Frisch 1911 -1991 |
|
#2
| ||||
| ||||
| Re: Can I put the Actual Date in Excel or VBA?
I am doing many R & D from last year for doing the same thing but not succeeded yet. All methods and the date functions will give you the timing that your system is showing to you. There are many date functions but that all will refer to your system date for showing the current date and time. If your system date is wrong then the function will return the same date which is wrong. So I don't think that there is some code that will predict the correct date and then will display to us. ![]()
__________________ IF you hate me, please don't mention it. I know who hates me and who doesn't. You really do not have to make fun of people.... |
|
#3
| |||
| |||
| Re: Can I put the Actual Date in Excel or VBA?
You can put the Actual Date in Excel or VBA by using the World Time Zone Database Subscription Service. The printed edition of the Time Zone Guide provides a comprehensive list of over 495 time locations ordered by their political names as shown on World Time Server.com. The plus point is that complete database in XML format and ASCII comma delimited format for easy import or direct use in any custom project development you create. The only and big drawback is that their subscription fee is $399.95 (US) per year. So I don't think that anyone will be interested for this service. ![]() |
|
#4
| ||||
| ||||
| Re: Can I put the Actual Date in Excel or VBA?
Thanks Friends for trying to solve my problem. I am shocked to hear that World Time Zone Database Subscription Service provides the service with the subscription fee of $399.95. I think that I will find some another way or I will use the same time that my system uses. I am not doing any important project neither I am creating any big application, so I will rely on my system time or date using the common functions like today() or now().
__________________ Technology is a way of organizing the universe so that man doesn't have to experience it.-- Max Frisch 1911 -1991 |
|
#5
| ||||
| ||||
| Re: Can I put the Actual Date in Excel or VBA?
If you are connected to the Internet then you can use the following coding for putting the actual date in Excel or VBA. Code: Private Sub Command1_Click() 'Main button to set the system
' time
On Error GoTo ErrHandler
Label3.Caption = "System Time has Not been Set Yet"
SetIt = 1 'Used to only set time if the time from the
' time server is valid and reportedly accurate
If Winsock1.State <> sckClosing Then 'Sometimes the
' Winsock gets delayed in the closing state, so
' make sure it is closed before trying again
If Winsock1.State = sckClosed Then 'If closed, ok to
' open, else close it
Timer1.Interval = 5000 'Start 5 second count to
' 'time' server
Timer1.Enabled = True
Screen.MousePointer = vbHourglass
Winsock1.LocalPort = 0 'Must be set to 0
Winsock1.RemoteHost = Trim$(Text1.Text) 'Address
' of NIST server
Winsock1.RemotePort = 13 '13, 37 or 123 'Use 13!
Winsock1.Protocol = 0 '1-UDP '0-TCP 'USE TCP!
Winsock1.Connect 'This is what goes out and gets
' the time
Else
Winsock1.Close
Screen.MousePointer = vbNormal
Timer1.Interval = 0
Timer1.Enabled = False
End If
Else
Winsock1.Close
Screen.MousePointer = vbNormal
Timer1.Interval = 0
Timer1.Enabled = False
End If
Exit Sub
ErrHandler:
SetIt = 0
Screen.MousePointer = vbNormal
Timer1.Interval = 0
Timer1.Enabled = False
MsgBox "The Winsock Connection is Unavailable."
Winsock1.Close
End Sub |
|
#6
| ||||
| ||||
| Re: Can I put the Actual Date in Excel or VBA?
Even I think that you should try for the NIST. The NIST Internet Time Service (ITS) allows users to synchronize computer clocks via the Internet. The service responds to time requests from any Internet client in several formats including the DAYTIME, TIME. The Network Time Protocol (NTP) is the most commonly used Internet time protocol, and the one that provides the best performance. Most of the NIST time servers do not require any authentication when requesting the time in NTP format, and no keys or passwords are needed to use this service.
__________________ The FIFA Manager 2009 PC Game |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Can I put the Actual Date in Excel or VBA?" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| End of Nations actual Release date and System Requirements? | Rodriguez_bronx | Video Games | 5 | 15-06-2012 06:15 PM |
| Updating actual and remaining work from Excel not updating properly | josocal | Microsoft Project | 1 | 13-02-2012 06:49 PM |
| What is the actual release date of postal 3 game | Vijayabhas | Video Games | 4 | 24-12-2011 09:08 AM |
| Date Separator in Excel | NIcaBoy | Windows Software | 2 | 25-03-2009 11:11 AM |
| Project 2007: Actual Finish Date & Finish | Tahseen Shahzad | Microsoft Project | 3 | 08-10-2008 04:53 PM |