Click here to Skip to main content
15,914,163 members
Home / Discussions / C#
   

C#

 
GeneralRe: Help in matching inputted string to a regex pattern Pin
riced5-Aug-09 4:44
riced5-Aug-09 4:44 
QuestionSerializationBinder and parsing type fullname Pin
Super Lloyd5-Aug-09 1:46
Super Lloyd5-Aug-09 1:46 
AnswerRe: SerializationBinder and parsing type fullname Pin
Super Lloyd5-Aug-09 4:00
Super Lloyd5-Aug-09 4:00 
GeneralRe: SerializationBinder and parsing type fullname Pin
Super Lloyd5-Aug-09 5:27
Super Lloyd5-Aug-09 5:27 
QuestionHow to test Web Methods with NUnit Pin
Phillip Donegan5-Aug-09 1:26
Phillip Donegan5-Aug-09 1:26 
Questionbyte array To text box is it possible? Pin
gwithey5-Aug-09 1:24
gwithey5-Aug-09 1:24 
AnswerRe: byte array To text box is it possible? Pin
musefan5-Aug-09 2:16
musefan5-Aug-09 2:16 
QuestionConvert String To Unix Timestamp Pin
iNutR5-Aug-09 0:27
iNutR5-Aug-09 0:27 
well i have a string which contains a unix timestamp.
when i try to convert the string to either a double or a int, it gives me an error.
im out of ideas, i dont know how to get the string into a int or double, so i can convert it from unix to datetime.

here is my code:

string validstrStart = "validuntil=";
     string validstrEnd = "username=";
     int validstartIndex = result.IndexOf(validstrStart);
     int validendIndex = result.IndexOf(validstrEnd);
     string valid = result.Substring(validstartIndex, validendIndex - validstartIndex);

     double timestampv = Convert.ToDouble(valid);
     System.DateTime dateTime = new System.DateTime(1970, 1, 1, 0, 0, 0, 0);
     dateTime = dateTime.AddSeconds(timestampv);
     string validpro = dateTime.ToShortDateString() + " " + dateTime.ToShortTimeString();


it gives me an error in this line:

double timestampv = Convert.ToDouble(valid);


same thing when i try with an int.

any help please Big Grin | :-D
AnswerRe: Convert String To Unix Timestamp Pin
Christian Graus5-Aug-09 0:31
protectorChristian Graus5-Aug-09 0:31 
GeneralRe: Convert String To Unix Timestamp Pin
iNutR5-Aug-09 0:36
iNutR5-Aug-09 0:36 
GeneralRe: Convert String To Unix Timestamp Pin
Christian Graus5-Aug-09 0:39
protectorChristian Graus5-Aug-09 0:39 
GeneralRe: Convert String To Unix Timestamp Pin
iNutR5-Aug-09 0:41
iNutR5-Aug-09 0:41 
GeneralRe: Convert String To Unix Timestamp Pin
Christian Graus5-Aug-09 0:47
protectorChristian Graus5-Aug-09 0:47 
GeneralRe: Convert String To Unix Timestamp Pin
iNutR5-Aug-09 0:54
iNutR5-Aug-09 0:54 
GeneralRe: Convert String To Unix Timestamp Pin
Christian Graus5-Aug-09 1:00
protectorChristian Graus5-Aug-09 1:00 
GeneralRe: Convert String To Unix Timestamp Pin
Michael Bookatz5-Aug-09 2:35
Michael Bookatz5-Aug-09 2:35 
GeneralRe: Convert String To Unix Timestamp Pin
stancrm5-Aug-09 0:52
stancrm5-Aug-09 0:52 
GeneralRe: Convert String To Unix Timestamp Pin
iNutR5-Aug-09 0:57
iNutR5-Aug-09 0:57 
GeneralRe: Convert String To Unix Timestamp Pin
Christian Graus5-Aug-09 1:01
protectorChristian Graus5-Aug-09 1:01 
GeneralRe: Convert String To Unix Timestamp Pin
iNutR5-Aug-09 1:47
iNutR5-Aug-09 1:47 
GeneralRe: Convert String To Unix Timestamp Pin
Michael Bookatz5-Aug-09 2:36
Michael Bookatz5-Aug-09 2:36 
AnswerRe: Convert String To Unix Timestamp Pin
Luc Pattyn5-Aug-09 4:26
sitebuilderLuc Pattyn5-Aug-09 4:26 
Questionsocket disconnection Pin
Vivek Vijayan5-Aug-09 0:23
Vivek Vijayan5-Aug-09 0:23 
AnswerRe: socket disconnection Pin
Christian Graus5-Aug-09 1:07
protectorChristian Graus5-Aug-09 1:07 
GeneralRe: socket disconnection Pin
Vivek Vijayan5-Aug-09 3:50
Vivek Vijayan5-Aug-09 3:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.