Conversation started Nov 20, 2013 at 17:18.
Nov 20, 2013 17:18
ok thanks
anyone want to compare my answer to the other answers on this Javascript question? I think that my answer is better.
0
A: How could I do DateTime.Now.Date (from c#) in javascript?

MalachiJavaScript Date Object this code will give you the date in the format mm/dd/yyyy (at least that is what it gave me, because that is my locale convention) var today = new Date(); document.write(today.toLocaleDateString()); Note: var today = new Date(); is a Date object that has ToString Metho...

@Jamal, will you tell me if I bent the rules to make this question openable, please.
2
Q: How to fix slow loading images using jquery mobile and phone gap?

sharatakaI have the following jquery mobile + phonegap app. I'm finding when I load the app, the images in the separate pages load pretty slowly. Any advice on how to either fix this? <html> <head> <meta charset="utf-8" /> <meta name="format-detection" content="telephone=no" /> ...

I GOT AMMO!!! A question must have been deleted or something, because now suddenly I have one vote left!
@Malachi your answer does look prettier. Actually it's better, but I'm out of votes...
@SimonAndréForsberg what?! Is that zombie looting?
@retailcoder Yeah, unfortunately it didn't drop a shiny diamond like Jamal has, but at least it dropped something!
@Malachi I actually agree with Vedran who commented on your answer. I think the accepted answer is better than yours (for this time)
Nov 20, 2013 17:37
@SimonAndréForsberg, what comment of his do you agree with? my code is shorter and clearer than the answer that was given, and works across a majority of browsers as shown by the Mozilla link that I gave along with the w3schools link that I gave. my code is cleaner.
@Malachi Your code gives a string, the OP wants a Date object
In the question comments, the OP wrote "@Guffa As I put in parentheses, I just use the expression without to mean the value 00:00:00 "
@Malachi: It sort of looks like it implies non-working code, so I wouldn't consider reopening right now. It doesn't seem clear if everything else works, and only a performance increase is desired.
the date object holds all of that information, but the OP wanted to return a String of the date, you view parts of the date object, in string format.
@Jamal, ok that sounds good. was the edit close to ok?
@retailcoder: I'm only focusing on questions scored 0 or lower (to save time). I have to trust that no one has upvoted too many off-topic questions.
@Malachi I don't see anywhere that he says he wants a string
Nov 20, 2013 17:46
@Malachi: Yes, that's good.
@SimonAndréForsberg, quoted from Mozilla "Note: Note that JavaScript Date objects can only be instantiated by calling JavaScript Date as a constructor: calling it as a regular function (i.e. without the new operator) will return a string rather than a Date object; unlike other JavaScript object types, JavaScript Date objects have no literal syntax."
@Malachi But it's not called without the new operator anywhere as far as I can see in the question
Date Objects return strings. they don't return other objects. the date object is an array of string values, except for the number of milliseconds from 1 January, 1970 UTC. so to see if the object is holding a value in the correct format you have to return a string.
maybe I am looking at this the wrong way @SimonAndréForsberg
"Date Objects return strings. they don't return other objects.", I believe that's incorrect, @Malachi
0
A: Call of Duty - We're on a mission

retailcoderSome "memes"... A few expressions have come up recently, thought I'd share them here (feel free to add, this is CW!) Running out of ammo: when you have exhausted all 40 votes for the day. Zombie looting: when you downvoted (upvoted?) a zombie question that ends up getting deleted, and then you...

Nov 20, 2013 17:58
the only way to achieve what the OP is asking (from assumptions one everyone's part) is to create a new DateLike object and give it a key that is the same thing as date.toLocalDateString or what the other answer says. does that make sense?
@Malachi I believe the OP is actually looking for a Date object with a year, month, and date specified, and with hour/minute/second set to zero.
Does this make the Civic Duty badge the Medal of Honor (or a lesser award)? :-)
@SimonAndréForsberg, the way that I read the question, the OP wants the String representation of the Date Object equivalent to DateTime.Now.Date is that how you read the question? does he want the object or the representation?
@Malachi, @SimonAndréForsberg reading all this back-and-forth I feel like voting to close for "unclear what you're asking" (/sarcasm)
2
@Malachi I believe he wants the object
@retailcoder close us or close the question? :)
Nov 20, 2013 18:06
@SimonAndréForsberg the question!
lol
@SimonAndréForsberg, what is he going to do with the object when he has it? he must need the String representation for some reason.
@Malachi Maybe he wants to compute stuff with it, maybe he wants to throw it in /dev/null, that's up to him :)
@SimonAndréForsberg Quoted from OP, "This will give the current date, without the TimeSpan value ('00:00:00'). In javascript I did this:"
giving the current date without the timespan value, he needed to see it, my code does "giving the current date without the timespan value" using the original Date Object
@Malachi Also quoting the OP (from comments), "@Guffa As I put in parentheses, I just use the expression without to mean the value 00:00:00"
@Malachi Besides, he's already accepted an answer and commented "I liked the idea of setting hours min and sec to 0"
@SimonAndréForsberg, I guess it is his code. good think he isn't going up against a master Coder/BS'er like me. I would win for sure.... :)
Nov 20, 2013 18:16
@Malachi Considering his reputation vs. yours, I'm sure you would :)
 
Conversation ended Nov 20, 2013 at 18:16.