8

Convert DateTime to Dual

 2 years ago
source link: https://www.codesd.com/item/convert-datetime-to-dual.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Convert DateTime to Dual

advertisements

I've created a DateTime value from an item being clicked in a listBox. It's in the format dd/MM/yyyy hh:mm:ss. I'm want to zoom in on a ten minute period with the clicked event in the middle. My current code is as follows (where zoom_time is the DateTime to zoom to on my chart;

chart1.ChartAreas[0].AxisX.Minimum = (Convert.ToDouble(zoom_time.AddMinutes(-5)));
chart1.ChartAreas[0].AxisX.Maximum = (Convert.ToDouble(zoom_time.AddMinutes(5)));

This breaks saying

"invalid cast from DateTime to double"

Any ideas guys?


You can use DateTime.ToOADate(), if you mean ole automation date by double

Related Articles

How to convert datetime to aayy-mm-dd hh: mm: format ss in perl?

This question already has an answer here: Converting date to specified format and two date comparisions 2 answers How do I convert datetime to a different format? This is my date: Tue Feb 11 08:47:59 2014 how to convert to 2014-02-11 08:47:59 Thanks!

MySQL Script to convert DateTime.Ticks values ​​to SQL Date

I have an old MySQL database where I stored dates as C# DateTime.Ticks. Now I want to convert that old database to a new structure for a PHP app that has needs a datefield. How do I convert DateTime.Ticks to MySQL dates? I am looking for something in

PHP converts datetime into SQL statements

Is it possible to convert datetime from SQL statements ? Example : SELECT * FROM t_status WHERE Function to Convert(date_added) BETWEEN '2013-05-01' AND '2013-05-31' My date time format in table t_status like this : 2013-05-20, 18:00 <-- contains tim

MySQL converts datetime to Unix timestamp

How do I convert the following format to unix timestamp? Apr 15 2012 12:00AM The format I get from DB seems to have AM at the end. I've tried using the following but it did not work: CONVERT(DATETIME, Sales.SalesDate, 103) AS DTSALESDATE, CONVERT(TIM

convert DateTime to a string according to customCultureInfo in G format ((combination of date and time)

I have changed my system date format to Faeroese. I want to convert DateTime to String according to customCulture with G format (combination of date and Time) check the below code. namespace TestDateConvertion { class Program { static void Main(strin

Convert Datetime format to varchar style solution

I have a datetime column that I need to display in the following format: YYYY/MM/DD 00:00:00:000 With CONVERT, I can't find any suitable styles. The / in the format is really important as it needs to be compared with a VARCHAR column that has text YY

Convert DateTime to C # in yyyy-MM-dd format and save it in MySql DateTime Field

I am trying to convert DateTime format to yyyy-MM-dd format and store it to DateTime object. But it gives me the System DateTime format that is MM/dd/yyyy. I am using following code to convert. string dateTime = DateTime.Now.ToString(); string create

Convert DateTime to Julian Date in C # (ToOADate Safe?)

I need to convert from a standard Gregorian date to a Julian day number. I've seen nothing documented in C# to do this directly, but I have found many posts (while Googling) suggesting the use of ToOADate. The documentation on ToOADate does not sugge

Converting DateTime stamps to Unix with Python

I can't seem to get a time stamp into a unix timestamp format and assume I'm missing some points. Looking for some help. I have a column within a df that is a datetime object in the format: YYYY-MM-DD HH:MM:SS and I need a new column with the unix st

Convert datetime to ordinal to python fails

i been had worked with dates. I want to convert datetimes to ordinal but my script fails. from datetime import datetime date = "2016/12/07 17:45" date_strip = datetime.strptime(date, '%Y/%m/%d %H:%M').date() ordinal = date_strip.toordinal() # or

Convert DateTime to String Value?

How do I convert DateTime to an Integer value? Edit: How do I convert DateTime to a String value? Example String return value of 20100626144707 (for 26th of June 2010, at 14:47:07) That could not be represented as an integer, it would overflow. It ca

Convert datetime.ctime () values ​​to Unicode

I would like to convert datetime.ctime() values to Unicode. Using Python 2.6.4 running under Windows I can set my locale to Spanish like below: >>> import locale >>> locale.setlocale(locale.LC_ALL, 'esp' ) Then I can pass %a, %A, %b, and

How to convert datetime-local to datetime while storing and retrieving from the database

I am beating my head around making this possible how do i convert datetime-local which i am using in jquery mobile and store data as datetime as my field is datetime in the database '<input type="datetime-local"' + demodata + ' />'; I am u

Conversion failed when converting datetime from a string

I am trying to pass parameters from windows application to a stored procedure. there are two parameters '@dt' & '@dt2' which get value from datetimepickers. whenever i execute the stored procedure it comes up with the error saying "Conversion fai

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK