datetime.now and server datetime ?

hi

how can i get datetime of server without storedprocedure ?

my code is below in *.aspx.vb

DateTime.Now()

Thanks


Mark as me if my question or my answer can be helpful for you :)
0
oguzkaygun
3/11/2009 1:08:36 PM
asp.net.web-forms 93655 articles. 6 followers. Follow

6 Replies
1388 Views

Similar Articles

[PageSpeed] 34

oguzkaygun:

hi

how can i get datetime of server without storedprocedure ?

my code is below in *.aspx.vb

DateTime.Now()

Thanks

Dim dt As Date = Date.Now

Dim strtime As String = dt.ToShortTimeString()

 


MAKMark as Answer if this reply helps you
MVP ASP/ASP.Net
MVP ASP/ASP.Net
ASP.Net Hosting : Host DepotMy Site : ASPSnippets
0
mudassarkhan
3/11/2009 1:15:02 PM

 I don't see what's wrong with what you have. The code you posted does exactly that:

 

Dim dt As DateTime.Now
 
 
  
My Blog
0
booler
3/11/2009 1:17:10 PM

hi

datetime.now get my computer's datetime.. is it wrong?

i want to get server's (hosting) datetime..how can i get it?

Thanks

 


Mark as me if my question or my answer can be helpful for you :)
0
oguzkaygun
3/11/2009 1:45:48 PM

Since now you are running website on ur machine hence ur machine is the server

when you deploy it it will give the hosting service server time


MAKMark as Answer if this reply helps you
MVP ASP/ASP.Net
MVP ASP/ASP.Net
ASP.Net Hosting : Host DepotMy Site : ASPSnippets
0
mudassarkhan
3/11/2009 2:00:39 PM

I guess since the code runs in application server, it will be servers time. I thought like if i place a image in server and give the path c:\\documents.... Will the image be loaded from server or from the users C drive


Thanks,
Nideesh.S

Mark as answer, If it helps you.
0
nideeshm
3/11/2009 2:01:55 PM

I guess since the code runs at application server, it would give the server time. i thought like if i add a image in a page and src as c:\documents and settings... will the image gets loaded from server or from users machine.

I guess if a datetime is obtained using javascript it will give users time


Thanks,
Nideesh.S

Mark as answer, If it helps you.
-1
nideeshm
3/11/2009 2:11:05 PM
Reply:

Similar Artilces:

.NET DateTime and SQL Server DateTime problem
.NET DateTime and SQL Server DateTime problem  I have the following if statement in an SQL stored procedure: IF (@Image = 1 AND @DateTimeUploaded = (SELECT ImageMainDateTime FROM Images WHERE UserID = @UserID))   The value of the @DateTimeUpdated variable was taken from the ImageMainDateTime field when the data was requested by a ASP.NET webpage and is passed back here when that page is submitted so I can compare what the DateTime was when the data was requested with what it is now, in other words I’m doing a concurrency check (I can’t use TimeStamp for many reasons, ...

As DateTime = DateTime.Now....
Hello: I have a process that runs and would like to preserve the computer time inside of the variable when the process finishes. Using this method Dim dtDateTimeVar As DateTime = DateTime.Now the information inside the variable does not stay static and keeps changing with the time... what can I do to work around this?Need ASP.NET web hosting? Private Message me for a free quote. I have even tried something like this... Dim dtDateTimeVar as DateTime = DateTime.Now Dim varOldTime as String varoldtime = dtDateTimeVar It still gets the current time instead of the...

datetime.now() and datetime.now().addmonths()..insert code run before.. but it doesnt run now... i have no done anything.. why dont it run itself ?
hi datetime.now() and datetime.now().addmonths().. it run before.. but it doesnt run now... i have no done anything.. why doesnt it run now ? my datatype is datetime.. what can problem be ? sds.InsertParameters.Add("ilanbaslangictarihi", DateTime.Now()) hello friends when i change 14.06.2008 to 10.06.2008 from my computer, inserting run for datetime.now() but when i change 10.06.2008 to 14.06.2008 from my computer.. inserting doesnt run for datetime.now() Also when i enter {0:dd/MM/YYYY hh:mm:ss} to formatstring of edit column of gridview, gridview display 33.06.2008 1...

Issue when converting XML dateTime to .NET DateTime
Hi, I am experiencing an issue when deserializing XML dateTime nodes in ASP.NET in some timezones. The construct 0001-01-01T00:00:00.0000000+ZZ:ZZ where ZZ:ZZ is the timezone offset for the timezone on the current system should produce a DateTime value equalling the constant DateTime.MinValue when converted. This works some of the time, such as for the Paris time offset of +1: (CDate("0001-01-01T00:00:00.0000000+01:00") = DateTime.MinValue) = True But does not work for Sydney time offset of +10: (CDate("0001-01-01T00:00:00.0000000+10:00") = DateTime....

Inserting DateTime from web server with en-AU into database server with en-US
Hi there, How when I am using ADO.net can I pass a C# .Net DateTime object with en-AU culture to a en-US db server? i.e. can I set the culture of a DateTime object? I know I can do the DateTime.Now.ToString(new culture("en-US")) but that only converts it to a string. I want to be able to set the Culture of my DateTime object prior to passing it into the Stored Proc. Cheers Rob Hi rcfearn, You could specify the format when you convert a string/datetime to a new datetime with "Convert.ToDateTime" method. Please check the samples and details in this link. Thanks.D...

Datetime to xsd:datetime
Dear all, i need to create a datetime variable with this format: "2003-02-04T13:58:59.9999999+03:00"? i need the variable in Datetime format not string format.. Thanks. Cisatlantic: Dear all, i need to create a datetime variable with this format: "2003-02-04T13:58:59.9999999+03:00"? i need the variable in Datetime format not string format.. Thanks. So what's the problem?  If you declare a variable as a datetime it will serialize in the above format automatically, and the calling objects will treat it as a date when it receives it. no problems, it worked, thanks...

DateTime format for web server
I have put together a simple Apache2 web server on SUSE 11.1 using mono (ASP.NET). I noticed though that when I go to my sample web page that the time format is in military time. How can I configure apache to display in normal US time, that is am and pm. :\ :) -- Z_K ------------------------------------------------------------------------ This is not an Apache issue, it's your Mono app that displays it. So you should look at your program. -- ken_yap ------------------------------------------------------------------------ ken_yap's Profile: http://foru...

Convert .NET DateTime format to SQL DateTime format
Hi!!I'd like to know if there is a function to convert the DateTime format used in C# (VS2005) : dd/mm/yyyy HH:mm:ss to the format used in SQL Databases: yyyymmdd HH:mm:ssThanks folks!...

Problem datetime when transferring local SQL Server to Web Hosting SQL Server using XML Webservice
Dear all, We have recently integrated our internal timetracking (TT) system (Windows forms based )so that it can retrieve info from our (web based) bug tracking (BT) system. The BTS SQL Server is hosted in the USA on a shared server, the TT SQL server is stationed at our office in Phnom Penh, Cambodia. During development we tested the XML webservice that handles the actual datatransfer between the two systems and everything works fine. After deployment of the XML webservice to the live environment (hosted service in USA) problems showed up: DateTime values arrive malformed. Examples:...

DateTime problem in Web Form with SQL
Hi - Hope someone can shed some light on this issue: I am setting up a Web application. A date is required to be input through the html page. I need this date set to "dd/MM/yyyy" format and later use it to query and possibly update a database. So far I have a string which has been set as follows: string dStr = DateTime.Now.ToShortDateString(); All fine - dStr is in the format "dd/MM/yyyy" Later I want to convert this string to a datetime to store in a db DateTime tDate = new DateTime.Parse(dStr); string strIns = "In...

C# DateTime and SQL Server "DateTime" column type
If I have a property in a class that will be set to a date returned from a SQL Server DateTime column... Should my property be of type "string" or type "DateTime". Hi Son Volt,You would have to use DateTime type in your class.Good Coding!Javier Luna http://guydotnetxmlwebservices.blogspot.com/from Villa El Salvador for world!...

Implementing .Net Form into an APS.net web form, can this be done
I am new here, but have been searching for a while, and may not have the correct lingo to find what I am looking for.  I am tasked with implementing a .exe application that was writen vb6 then converted to .net into a new website my team is developing. The idea is to put each of the 3 different forms in this .exe application of 3 different .aspx pages. I have attempted multiple things to get this into the page and even started to just rewrite it as an ASP.net web form, but even then I can't reuse any of the code since the System.Web.UI.Page doesn't inherit the sa...

convert an sql datetime column to .net datetime data type in front end...?
I have a field (ldate) in a table that typically displays data in the following format:2007-11-12 20:30:47.000In the front end I want the time and the date separately. But as I try to cast it to a datetime object it is giving me a System.NullReferenceException. What I tried to do was just this: Protected Sub gvTopics_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvTopics.RowDataBound Dim img As Image = gvTopics.FindControl("imgIcon") Dim lbDate, lbTime As Label lbDate = gvTopics.FindControl(...

DateTime conversion error between SQL Server and .NET?
Not sure where best to post this because I am not sure where the error is occuring.... but....  I'm taking a DateTime in C#, and saving it to SQL Server 2005 as a DateTime.  When it is reloaded out of the DB back into C# (as a DateTime), I'm seeing between a few microseconds and so far up to 2 milliseconds in difference.  The process I'm using, takes a DateTime and saves it to SQL Server.  This DateTime is then converted ToBinary().ToString() and saved temporarily in in C#. Then I re-load the DateTime that was saved in SQL ...

Web resources about - datetime.now and server datetime ? - asp.net.web-forms

Is there a JQuery plugin to convert UTC datetimes to local user timezone?
If I have a tag: <span class="utctime">2010-01-01 11:30 PM</span> I would like a jquery script or plug in to convert every utctime ...


Targetprocess 3.7.3: Epic unit for Bug/Story cards, new DateTime functions in Webhook plugin
Webhook plugin supports new DateTime functions AddDays(DateTime date, int days) – Returns a new date with the number of days added. The number ...

Common Pitfalls when working with DateTime’s
In .NET, the DateTime structure provides us wonderful functionality, but this seemingly simple structure can cause a lot of headaches if you ...

Parsing Twitter Date format to .Net DateTime
Recently when I needed to parse the twitter datetime format into a .Net DateTime I found this post on the web showing how to do it. However, ...

C Sharp (programming language) - Wikipedia, the free encyclopedia
(pronounced see sharp ) is a multi-paradigm programming language encompassing strong typing , imperative , declarative , functional , generic ...

1753 - Wikipedia, the free encyclopedia
Language: English Afrikaans አማርኛ العربية Aragonés Asturianu Aymar aru Azərbaycanca বাংলা Bân-lâm-gú Basa Banyumasan Беларуская ‪Беларуская (тарашкевіца)‬ ...

Coded Smorgasbord: Schizophrenic Haiku Comments and More
... writes Malcom StandardResponse UnSubscribeNewsletterUserAccount( string opTinGUID,string email, string sellingRegion, string source, DateTime ...

Limburg.be - Welkom op de site van de provincie Limburg - Welkom_op_de_site_van_de_provincie_Limburg
visit wonen werken leven ontspannen infopunt home op trefwoord contactpersonen wegwijs sitemap print deze pagina Je bent hier: limburg.be Contact ...

Simples Ideias. Por Nando Vieira.
Simples Ideias Siga-me no Twitter Junho/2012 Usando o Vagrant como ambiente de desenvolvimento no Windows http://simplesideias.com.br/usando ...

Resources last updated: 1/17/2016 9:20:46 PM