1
A
답변
7
날짜가 DateTime
인 날짜로 작업하는 것이 좋습니다.
string dataNow = DateTime.Today.AddDays(20).ToString();
업데이트 후 :
현재 월의 일 수를 얻으려면 당신이 날짜를 조작 완료하기 전에하는 경우, ToString()
를 호출하지 않습니다 :
var date = DateTime.Today;
int days = DateTime.DaysInMonth(date.Year, date.Month);
0
이 그것을 수행해야합니다
DateTime dtNow = DateTime.Today;
string dateNow = dtNow.ToString();
string dateAfter = dtNow.AddDays(20).ToString();
int DaysInTheMonth = DateTime.DaysInMonth(dtNow.Year, dtNow.Month);
0
DateTime today = DateTime.Today;
DateTime later = today.AddDays(20);
string todayAsString = today.ToString("d");
string laterAsString = later.ToString("d");
int daysThisMonth = DateTime.DaysInMonth(today.Year, today.Month);
int daysLaterMonth = DateTime.DaysInMonth(later.Year, later.Month);
관련 문제
- 1. 어떻게 문자열 [] <String>
- 2. HashMap <String, String>에서 키의 목록 <String>을 어떻게 얻을 수 있습니까?
- 3. 목록 만들기 <string> 사전에서 <string, string>
- 4. System.Collections.Generic.Dictionary <string, string>
- 5. <String> to String
- 6. List <KeyValuePair <string, string >>>을 어떻게 단축 할 수 있습니까?
- 7. List <keyvaluepair <string, string >>의 여러 키를 어떻게 확인할 수 있습니까?
- 8. 을 IEnumerable <KeyValuePair <T, string>>. 어떻게?
- 9. Android ArrayList <HashMap <String, String >>
- 10. <사전 <int, string>>
- 11. 어떻게 변환하는 벡터 <벡터 <string>은>
- 12. IDictionary <string, IDictionary <string, ICollection <string> >> LINQ
- 13. ArrayAdapter의 ArrayList <HashMap <String, String >>
- 14. 문제는 <String>
- 15. 는 <String>
- 16. JAXB to unmarshall <string> foobar</string>
- 17. <Func을 <T, string>>
- 18. List <KeyValuePair <string, string >>
- 19. ObjectResult <string>을 ObjectModel.Collection으로 변환 <string>
- 20. ArrayList의 값이 잘못되었습니다. <HashMap <String, String >>
- 21. <String[]>는
- 22. 콜렉션 <String>
- 23. 는 <String, ?>
- 24. JPA Map <String, String> mapping
- 25. 어떻게 사전에 구문 분석 <string, string> C#
- 26. System.IObservable <string> to System.IObservable <System.Collections.Generic.List <string>>
- 27. 사전 <string, string> 대 해시 테이블 <string, string>
- 28. SWIG는 파이썬에서 <string, string> 맵을 어떻게 감쌀까요?
- 29. 사전을 포함한 <string, string> 사전
- 30. POJO에서지도 <String, String>을 생성하십시오.
많은 감사를 !!!!!!!!!!!!!!!! – CyberDx
@CyberDx : 문제를 해결할 때 대답을 수락하는 것을 고려해야합니다. –