Add Hours And Minutes To The String?

Jun 2, 2010

I have the date format string dd-mm-yy. how to add hours and minutes to the string (i.e 13-03-2010.21.03) ....

DateTime.Today.ToString("dd-mm-yy") ?

View 5 Replies


Similar Messages:

Creating Data With Hours And Minutes?

Jan 12, 2010

I have a textfield where they can enter a date, a hour drop down and a minute dropdown.

What I would like to do is after i get the values for each to create a DateObject which has all 3. i.e 12/02/2009 15:36

But then also how dismantle the Date Object to get back my 3 individual values

View 4 Replies

Web Forms :: Convert Minutes To Hours And Display Using C#

May 7, 2015

my output is 87:02 hours 87 minutes 2

using (SqlConnection conn = new SqlConnection(constr))
{
using (SqlCommand cmd = new SqlCommand("SELECT CONVERT(VARCHAR(10),InTime,108 ), CONVERT(VARCHAR(10),outTime,108 ) FROM aten WHERE Id = '" + txtid.Text + "' and date between '" +

[Code].....

View 1 Replies

State Management :: How To Increase Session Timeout From 20 Minutes To 1 Or 2 Hours

Jul 28, 2010

In my webconfig i put

<system.web>
<sessionState timeout="60"/> doesn't work for me

Also i changed in IIS configration Manager as well from 20 minutes to 60 minutes, but still it expire after 20 minutes of no actiuvity.

View 8 Replies

C# - Comparing Two Times That Are Shown On Form As Dropdowns For Hours And Minutes

Feb 8, 2011

I have been working on a .NET/C# form that contains two time fields that are built out of dropdowns. Time A is made up of two dropdowns for Hours and Minutes and Time B is made up of two drop downs for hours and minutes too. I need to compare the two in order to ensure that Time A is always greater than B. I could just use a CompareValidator to check the hours, that works BUT doesn't take into account the minutes. So lets assume the following scenarios:

A = 11:00 B = 12:15 is fine my validation accepts this as it should do
A = 11:15 B = 11:00 is accepted because the hours are equal but otherwise shouldn't pass as the minutes aren't validated

How would you ensure B is always equal to or greater than A where dropdowns are used? I would if I could change this but not permitted to do so.

View 2 Replies

Calculating Years, Months, Days, Hours, Minutes, Seconds Between Two Dates?

Oct 20, 2010

I'm trying to calculate the yrs, months, days, hours, mins, seconds between two dates with sql server or c# (ive just used sql more).

I have some code below that I started, but I get some negative values for months, values over 31 for months, and there very well could be more issues. Honestly my math is not the greatest and Im just not sure how to fix it. I want the user to be able to enter their birthday and for it to calculate the yrs, months, days, hours, mins, and seconds they have been alive.

[Code]....

View 5 Replies

Web Forms :: Calculate Relative Time - Minutes / Hours Or Weeks Ago In Words

May 7, 2015

I would like to get the accurarte (days, minutes, months and years) differnce between two date time variables and not just who is greater.

Is there a better way to do it then run DateTime's methods (TotalDays, TotalHours, TotalMinutes. etc...) and do the calculation?

The bottom line is to display something like "a minute ago", "an hour ago", "Three weeks ago", etc...

View 1 Replies

C# - Convert String Time Like (0740) Into 12 Hours (AM - PM) Format Like (07:40 AM)

Jan 1, 2010

How can i convert string time into 12 hours (AM,PM) time format? Like if input string will like "2320" than i want answer like "11:20 PM".

View 2 Replies

Security :: How To Redirect The User After 2 Minutes If There Is Inactivity For 2 Minutes

Feb 13, 2011

I want to redirect the user after 2 mins if there is inactivity for 2 mins. I am not using ASP.NEt membership. And I dont want to use Sessiontimeout for this. Session timeout will logout the user even if he is working on the system. My objective is like screensaver process.

If there is no action for the specified time, the screensaver runs. Similarly, I want to redirect the user to login page.

note that i have already handled it with the following javascript:

[Code]....

Here what my problem is,

the user is working on the site...ok.. he want to see someother site.he browse someother site and works on....or even he can do some other work in his system...but he is active in his system... What this script does is, it automatically logout the user and redirect him to login page. But it should not do while he is active...IT SHOULD REDIRECT IF HE IS NOT ACTIVE REALLY (Similar to Screensaver process)

Is it possible ?

View 1 Replies

Gridview Footer / Total Hours In The Footer (sum Of Hours For All Rows)?

Jan 29, 2011

I have a grid view which contains Hours as one of the columns.. now, i need to have a total hours in the footer (sum of hours for all rows).

View 2 Replies

Web Forms :: How To Calculate The Hours

Sep 25, 2010

How would you calculate the hours?

Example:
05:00 15:00 = 10 hours
07:00 12:00 = 5 hours
12:15 to 14:30 = 2 hours 15 minutes.

View 2 Replies

Executing A C# Function After Each 24 Hours?

Mar 20, 2011

I have a c# function for producing thumbnail images, these images are displayed on web-page i.e ASP.netSo how would i programtically call this back-end function let say everyday at 16:00 or at 3:00.

View 3 Replies

SQL Server :: Get Data During Last 24 Hours?

Aug 15, 2010

How do I get the data during last 24 hours ?

View 5 Replies

Show Data 24 Hours?

Nov 22, 2010

i have 30 data. i want show 24 hours at 24 hours only a data.

View 11 Replies

Timeouts For Process That Can Take Hours

Nov 22, 2011

I have a web service that sends up to 5000 emails to our customers.

It is called asynchronously from a web application and then chuggs away sending the emails. Generally it works okay. Yesterday, it kept stopping - sometimes after sending a small number (33 first time) and then it might send another couple of hundred - then 50 or so etc. This went on all day as I kept manually calling the web service.

The data (subject, body, fromaddress, replytoaddress etc) is all kept in the database - as are the recipients.

Here's the code that gets the data from the database.

// Create Instance of Connection and Command Object
SqlConnection myConnection = new SqlConnection(ConnectionString);
SqlCommand myCommand = new SqlCommand("CPEmailsToSend_List", myConnection);

// Mark the Command as a SPROC
myCommand.CommandType = CommandType.StoredProcedure;
myCommand.CommandTimeout = 1000;

[Code]....

So I have a dataset containing 3 sets of data - the subject, body etc., a list of attachments and a list of recipients. I then use the .net smtpClient like this:

Code:
//about to start sending emails - update the MessageSendStatus to inprogress
myCommand.CommandText = "CPEmailSendStatus_Update";
myCommand.Parameters.Clear();
myCommand.Parameters.Add("@CPEmailID", SqlDbType.Int).Value = CPEmailID;
myCommand.Parameters.Add("@SendStatus", SqlDbType.TinyInt).Value = 1;

[Code] ....

When the web service stopped (it kept stopping yesterday) - no errors were raised. I have a function on the page that checks the email address is valid before I try to send the email as I know the smtpClient does not like invalid email addresses. Normally, invalid email addresses are trapped and the loop continues and sends the next one etc. But, yesterday, it just stopped sending. No error messages - nothing.

So, I began to wonder if the Command object is timing out. With a lot of email addresses to send to (up to 5000) and half a dozen attachments - the web service can take a long time (hours) to send all the emails. So, is the fact that I am reusing the command object over and over again for different stored procedures the issue? (I do this a lot and have never had a problem before - I read somewhere that the CommandTimeout only counts the time network access is used).

I've been sending test emails all morning (but I can only send small batches as I have a limited number of email addresses I can send test emails to) and they have all worked okay ... but, yesterday, trying to send about 5000 emails took about 30 attempts.

View 1 Replies

How To Calculate The Percentage Of Scheduled Hours

Aug 30, 2010

I have weekly wise scheduled hours of each employee and no of days scheduled for each employee,now i need to calculate no of employees scheduled less than 24 hours,no of emp's scheduled b/w 24 and 48 hrs and emp's scheduled more than 48 hrs in percentage for fisrt week,second week,3rd week and 4th week.

Like this

SCheduled Hrs 8/1/2010 8/8/2010 8/15/2010 8/22/2010

Less tha 24 hrs 5% 5% 5% 5%

b/w 24 and 48 hrs 4% 5% 5% 5%

>48 91% 90% 90% 90%

View 5 Replies

C# - TimeSpan Format With Hours Optional?

Jan 17, 2011

I have a timespan ts that has mostly minutes and seconds and sometimes hours. I'd like to format a string that'll give these results depending on the data

3:30 (hours not displayed, showing only full minutes)
13:30
1:13:30 (shows only full hours instead of 01:13:30)

So far I have

string TimeSpanText = string.Format("{0:h\:mm\:ss}", MyTimeSpan);

but it's not working.

View 3 Replies

Web Forms :: Schedule Hours For Using WebApp?

Jul 22, 2010

Schedule Hours for Using WebApp?

View 7 Replies

Sending Automatic E-mail Every 24 Hours?

Nov 16, 2010

Not sure if this can be done with ASP.NET, even the concept what I am trying to do...

I have some customers who I would like to send thank you letter automatically who bought online products from our website this day. Ofcourse if a customers buys something, he/she gets the

receipt and an order detail by e-mail. BUT I would like to send to all of the customers an additional e-mail, at same time ( for example 4 PM) to all the customers automatically.

I HAVE the code to send email to a recipent, database which contains all the customers who bought product this day. This works if I open the webpage and for example click a button or other events happen.

Is is possible that at a certain time, the ASP page automatically invokes the method (function) and send automatic E-mails to all customers? Or is this handled by other ways?

View 12 Replies

Web Forms :: Calendar Control - Show Hours In Day?

Aug 18, 2010

Is there a way to show hour in the calendar control?

View 1 Replies

Configuration :: Getting Error / After 1 Or 2 Hours And Click One Button?

May 14, 2010

I open my website and it is ok, but if I wait for 1 or 2 hours and click one button. then the page error. However if you reopen it in the new browser window then it is ok again.

The error page is as the following:

Server Error in '/' Application.

Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.

Description:
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.

Source Error:

[Code]....

Stack Trace:

[Code]....

Version Information: Microsoft .NET Framework Version:2.0.50727.4016; ASP.NET Version:2.0.50727.4016

View 11 Replies

Security :: How To Enforce Logon Hours Validation

Oct 6, 2010

How to enforce logon hours validation

View 10 Replies

Deployed One Webservice Which Calls Function Which Going Take More Than 5 -6 Hours?

Feb 18, 2011

I deployed one webservice which calls function which going take more than 5 -6 hours. I am using this webservice on my asp.net page and I am calling this webservice asynchronously. So how should I increase webservice time out?

View 3 Replies

ADO.NET :: Select Query To Get Records Within Last 24 Hours In Nhibernate?

Oct 20, 2010

How to Retrive records within last 24 hrs using Nhibernate.I want to retrieve the 10 records within last 24 hours.

How can i achieve this using Nhibernate.

View 1 Replies

SQL Server :: How To Extract Records From Database Between Hours

Feb 4, 2011

I can get my records from my database between days with this query.

[Code]....

but i need filter data between hours..

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved