Search Results

Search found 12421 results on 497 pages for 'date arithmetic'.

Page 42/497 | < Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >

  • Asp.net Date Binding Issue with Nulls

    - by Matthew Kruskamp
    I have a nullable date in my database. I am connecting to it with a LinqDataSource, and binding with a FormView. It allows you to place dates fine, but if you remove the date I need it to insert the null value to the db. It is instead throwing an exception. <asp:TextBox ID="TxtStartDate" runat="server" Text='<%# Bind("StartDate", "{0:MM/dd/yyyy}") %>' /> Works fine if you place a date in it, but if you delete the date out of it and save, you get System.Data.SqlTypes.SqlTypeException: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM. How do I make it send null?

    Read the article

  • Most optimal way to convert to date

    - by IMHO
    I have legacy system where all date fields are maintained in YMD format. Example: 20101123 this is date: 11/23/2010 I'm looking for most optimal way to convert from number to date field. Here is what I came up with: declare @ymd int set @ymd = 20101122 select @ymd, convert(datetime, cast(@ymd as varchar(100)), 112) This is pretty good solution but I'm wandering if someone has better way doing it

    Read the article

  • File modified date/time changes when uploaded via FTP

    - by Nate Shoffner
    Hey /g/, FTP/PHP question here. On one of my pages I load .txt files from a directory. Pretty simple. I also display the modified date of the text file using this: date('m/d/Y', filemtime($file)); This works fine on my WAMP server but when I upload the files via FTP, the modified date is changed to when they were uploaded. I'm currently hosting on a free hosting provider (freehostia to be exact). Is there any way to keep the modified date/time from changing when it's uploaded? Or is there perhaps an alternative way to go about this? Any ideas are appreciated.

    Read the article

  • Saving a 'Date' using DataMapper on AppEngine+JRuby

    - by Ryan Montgomery
    I have a a model as follows: class Total include DataMapper::Resource property :id, Serial property :amount, Float, :default => 0.00 property :day, Date belongs_to :calendar end I am trying to select a specific Total from the data-store. class Calendar include DataMapper::Resource property :id, Serial property :name, String has n, :totals def get_total_for(date) return Total.first(:day => date, :calendar => self) end end When I call get_total_for(DateTime.now) I receive the following error on the call to the data-store. java.lang.IllegalArgumentException: day: org.jruby.RubyObject is not a supported property type. Is Date not allowed for usage in AppEngine? Is this a DataMapper issue? I have tried changing the name of the :day property to something else (hoping it was just a name conflict) but it doesn't seem to matter. Thanks for any help you can provide.

    Read the article

  • how to insert based on the date

    - by Gaolai Peng
    I have a table table1 (account, last_contact_date, insert_date), account and last_contact_date are primary keys. The insert_date is set with the time the recored being added by calling getdate(). I also have a temporary table #temp(account, last_contact_date) which I use to update the table1. Here are sample data: table1 account last_contact_date insert_date 1 2012-09-01 2012-09-28 2 2012-09-01 2012-09-28 3 2012-09-01 2012-09-28 #temp account last_contact_date 1 2012-09-27 2 2012-09-27 3 2012-08-01 The result table depends on the inserting date. If the date is 2012-09-28, the result will be table1 account last_contact_date insert_date 1 2012-09-27 2012-09-28 2 2012-09-27 2012-09-28 3 2012-09-01 2012-09-28 If the date is 2012-09-29, the result will be table1 account last_contact_date insert_date 1 2012-09-01 2012-09-28 2 2012-09-01 2012-09-28 3 2012-09-01 2012-09-28 1 2012-09-27 2012-09-29 2 2012-09-27 2012-09-29 Basically the rule is (1) if the inserting date is the same day, i will pick the lastest last_contact_date, otherwise, (2) if the last_contact_date is later than the current last_contact_date, I will insert a new one. How do I write a query for this insert?

    Read the article

  • Compare Date objects with different levels of precision

    - by brainimus
    I have a JUnit test that fails because the milliseconds are different. In this case I don't care about the milliseconds. How can I change the precision of the assert to ignore milliseconds (or any precision I would like it set to)? Example of a failing assert that I would like to pass: Date dateOne = new Date(); dateOne.setTime(61202516585000L); Date dateTwo = new Date(); dateTwo.setTime(61202516585123L); assertEquals(dateOne, dateTwo);

    Read the article

  • Convert date to gmt - php

    - by adbox
    Hey Guys, I am having a strange problem, maybe you can help: I'm trying to convert a date to GMT time, and this is what I'm doing: $date = '2010-05-27 23:02:01'; $gmt_date = gmdate('Y-m-d H:i:s', $date ); but the yield of $gmt_date is this: 1970-01-01 00:33:31 What am I doing wrong?

    Read the article

  • insert a date in mysql database

    - by kawtousse
    I use a jquery datepicker then i read it in my servlet like that: String dateimput=request.getParameter("datepicker");//1 then parse it like that: System.out.println("datepicker:" +dateimput); DateFormat df = new SimpleDateFormat("MM/dd/yyyy"); java.util.Date dt = null; try { dt = df.parse(dateimput); System.out.println("date imput parssé1 est:" +dt); System.out.println("date imput parsée2 est:" +df.format(dt)); } catch (ParseException e) { e.printStackTrace(); } and insert query like that: String query = "Insert into dailytimesheet(trackingDate,activity,projectCode) values ("+df.format(dt)+", \""+activity+"\" ,\""+projet+"\")"; it pass successfully untill now but if i check the record inserted i found the date: 01/01/0001 00:00:00 l've tried to fix it but it still a mess for me.

    Read the article

  • date picker in partial views asp.net mvc

    - by Renu123
    i used basic date picker in asp.net mvc and it works fine but now i converted my views in partial views at this time date is not working at all means nothing is displyed when i clicked in text box of date picker. the code that i have used is <script src="../Scripts/jquery-1.3.2.js" type="text/javascript"></script> <script src="../Scripts/ui.core.js" type="text/javascript"></script> <script src="../Scripts/ui.datepicker.js" type="text/javascript"></script> and the method used for it is <script type="text/javascript"> $(document).ready(function() { $("#txtTransationDate").datepicker(); }); </script> <input id="txtTransationDate" name="txtTransationDate" type="text" /> can you tell me how to display date picker in partial views. thanks.......

    Read the article

  • Disable time and date editing on Windows Mobile

    - by fbm
    Hi, Is there a way to disable time and date editing on a Windows Mobile device (via APIs or the registry)? I have an application using the time and date of a Windows Mobile PDA and I don't want the user to change it (the time and date) - unless - he/she has some kind of administrative rights. I haven't find a way to do it with the menus. Is it possible to do it in any other way? Thanks

    Read the article

  • php date() stuck

    - by WAC0020
    I am getting the date from my mysql database and that date is correct but when I use the date() function the minute part is stuck a 6 minutes. My mysql is returning 2010-06-15 09:59:18 Then in php I use this code: date('M d,Y H:m A',strtotime($row[4])) ** $row[4] is from my while loop ** When I echo this out I get: Jun 15,2010 9:06 AM I also have tried converting it to unix timestamp in my sql query, does the same thing. I noticed that the hours work and the seconds work but the minutes are stuck at 6. Does anyone have any ideas on what is going on?

    Read the article

  • Select *, max(date) works in phpMyAdmin but not in my code

    - by kdobrev
    OK, my statement executes well in phpMyAdmin, but not how I expect it in my php page. This is my statement: SELECT egid , group_name , limit , MAX( date ) FROM employee_groups GROUP BY egid ORDER BY egid DESC ; This is may table: CREATE TABLE employee_groups ( egid int(10) unsigned NOT NULL, date date NOT NULL, group_name varchar(50) NOT NULL, limit smallint(5) unsigned NOT NULL, PRIMARY KEY (egid,date) ) ENGINE=MyISAM DEFAULT CHARSET=cp1251; I want to extract the most recent list of groups, e.g. if a group has been changed I want to have only the last change. And I need it as a list (all groups).

    Read the article

  • Convert Date Format

    - by Pankaj Khurana
    Hi, I have a moodle installation in which there is a column in mdl_user table called firstaccess whose type is bigint(10) and contains date in following format 1266839570. I am writing a query for accessing users according to date filters. For e.g. i want to check which users firstaccess is greater than '2010-04-12'. How can i convert the date? These two date formats are different. I think firstaccess is unix timestamp. Should i change the '2010-04-12' into unix timestamp or there is a way to convert firstaccess i.e 1266839570 to yyyy-mm-dd format. Please help me on this. Thanks

    Read the article

  • saving date and time

    - by saeed talaee
    I want to save the time and date within my news but in the method below I save the time of the user and if his/her time is wrong, the wrong time will be save. How can I use the server's time instead. SqlConnection sqlconn = new SqlConnection(connStr); SqlCommand sqlcmd = new SqlCommand("insert into SubmitManuscript(username,title,authors,type,date,upload,reviewer1,email1,reviewer2,email2,reviewer3,email3)values(@username,@title,@authors,@type,@date,@upload,@reviewer1,@email1,@reviewer2,@email2,@reviewer3,@email3)", sqlconn); sqlcmd.Parameters.AddWithValue("@username", username); sqlcmd.Parameters.AddWithValue("@title", Text_Title.Text); sqlcmd.Parameters.AddWithValue("@authors", Text_Author.Text); sqlcmd.Parameters.AddWithValue("@type", dd_Type.SelectedItem.Text); sqlcmd.Parameters.AddWithValue("@date", DateTime.Now); //sqlcmd.Parameters.AddWithValue("@upload", "~/Suppelment/" +

    Read the article

  • help date format in vb.net

    - by bachchan
    Dim Con As OleDb.OleDbConnection Dim Sql As String = Nothing Dim Reader As OleDb.OleDbDataReader Dim ComboRow As Integer = -1 Dim Columns As Integer = 0 Dim Category As String = Nothing Dim oDatumMin As Date Dim column As String column = Replace(TxtDateMax.Text, "'", "''") 'oDatumMin = Convert.ToDateTime(TxtDateMin.Text) oDatumMin = DtpMin.Value Dim oPath As String oPath = Application.StartupPath ' Select records. Con = New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & oPath & "\trb.accdb;") Dim cmd As New OleDb.OleDbCommand 'Dim data_reader As OleDbDataReader = cmd.ExecuteReader() Sql = ("SELECT * FROM " & cmbvalue & " WHERE Datum>='" & oDatumMin & "'") cmd = New OleDb.OleDbCommand(Sql, Con) Con.Open() Reader = cmd.ExecuteReader() Do While Reader.Read() Dim new_item As New ListViewItem(Reader.Item("Datum").ToString) new_item.SubItems.Add(Reader.Item("Steleks i krpe za cišcenje-toal papir-ubrusi-domestos").ToString) new_item.SubItems.Add(Reader.Item("TEKUCINA ZA CIŠCENJE PLOCICA").ToString) new_item.SubItems.Add(Reader.Item("KESE ZA SMECE").ToString) new_item.SubItems.Add(Reader.Item("OSTALO-džoger-spužva za laminat").ToString) new_item.SubItems.Add(Reader.Item("PAPIR").ToString) LvIzvjestaj.Items.Add(new_item) Loop ' Close the connection.strong text Con.Close()`` when i select table,(cmbvalue) from combobox and when i select date from datetime picker (dtp) or in last case from texbox converted to date and time sql looks like this "SELECT * FROM Uprava WHERE Datum='2.6.2010 10:28:14'" and all query looks ok but am geting Data type mismatch in criteria expression. error for date (oDatumMin) when excute column in access is also set to date i have no idea what else to try

    Read the article

  • String date time format

    - by Phil
    Hi i am using the vimeo API and i want to convert the string to a short date formate {0:d} or {0:dd/mm/yyyy}. This is my code but doesnt seem to be working for me. select new VimeoVideo { Date = String.Format("{0:d}",(item.Element("upload_date").Value)), }; return Vids.ToList(); } public class VimeoVideo { public string Date { get; set; } } Any help would be much appreciated Thanks

    Read the article

  • artisteer wp-theme metadata (date, category) lost

    - by Mattias Svensson
    I am going nuts over wordpress and artisteer. I am trying something that used to be pretty straightforward - turning on and off the display of date and post category for my posts on my blog page. I find this in content.php global $post; theme_post_wrapper( array( 'id' => theme_get_post_id(), 'class' => theme_get_post_class(), 'title' => theme_get_meta_option($post->ID, 'theme_show_page_title') ? get_the_title() : '', 'heading' => theme_get_option('theme_single_article_title_tag'), 'before' => theme_get_metadata_icons('date', 'header'), 'content' => theme_get_content() ) ); And the instruction says that all you got to do is insert or remove 'date' in the 'before' line. I've done it back and forth with my content files and nothing changes on the output. I can't find the actual code that prints it all, wordpress used to be so simple before everything was dug down 10 levels deep and you now have to look through millions of different functions to find the simplest things... As you can probably tell, I usually don't work with WP =) But this is on my table now and I haven't stayed up to date with WP for a couple of years... Any input as to where I can find the variables is appreciated... I had expected to at some point find 'posted at '.echo($date).' in category '.echo($category) or something at least remotely similar...

    Read the article

  • Should I use DATE and TIME as fields rather than DATETIME

    - by whitstone86
    I have a project on going for a TV guide, called mytvguide in the database - I use PHPMyAdmin. This is the structure for one table, which is called tvshow1: Field Type channel varchar(255) date date No airdate time No expiration time No episode varchar(255) setreminder varchar(255) but am not sure how to get DATE, TIME to work with the pagination script (below is the script, which works for the version with DATETIME): http://pastebin.com/6S1ejAFJ However, although the DATETIME one works - it shows programmes that air on the day itself like this: Programme 1 showing on Channel 1 2:35pm "Episode 2" Set Reminder Programme 1 showing on Channel 1 May 26th - 12:50pm "Episode 3" Set Reminder Programme 1 showing on Channel 1 May 26th - 5:55pm "Episode 3" Set Reminder but I'm not quite sure how to replicate that for the fields that use DATE, TIME functions as seen above. Any advice on this is appreciated, thanks!

    Read the article

< Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >