Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
assignments_new
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Suresh Kumar
assignments_new
Commits
1aa14c51
Commit
1aa14c51
authored
Jun 28, 2022
by
Suresh Kumar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Time-Stamp
parent
6c965654
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
111 additions
and
0 deletions
+111
-0
org.eclipse.jdt.core.prefs
Time-Stamp/.settings/org.eclipse.jdt.core.prefs
+12
-0
StringValidity.java
Time-Stamp/src/com/task1/StringValidity.java
+31
-0
CheckLeapYearOrNot.java
Time-Stamp/src/com/task3/CheckLeapYearOrNot.java
+23
-0
DateFormates.java
Time-Stamp/src/com/task4/DateFormates.java
+33
-0
FindSecondsAndMilliSeconds.java
Time-Stamp/src/task2/com/FindSecondsAndMilliSeconds.java
+12
-0
No files found.
Time-Stamp/.settings/org.eclipse.jdt.core.prefs
0 → 100644
View file @
1aa14c51
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=1.8
Time-Stamp/src/com/task1/StringValidity.java
0 → 100644
View file @
1aa14c51
package
com
.
task1
;
import
java.util.Scanner
;
public
class
StringValidity
{
public
static
void
main
(
String
[]
args
)
{
Scanner
sc
=
new
Scanner
(
System
.
in
);
System
.
out
.
print
(
"Enter A Name .. "
);
String
name
=
sc
.
nextLine
();
boolean
isValid
=
true
;
for
(
int
i
=
0
;
i
<
name
.
length
();
i
++)
{
char
ch
=
name
.
charAt
(
i
);
if
(
ch
>=
'a'
&&
ch
<=
'z'
||
ch
>=
'A'
&&
ch
<=
'Z'
)
{
continue
;
}
isValid
=
false
;
}
if
(
isValid
)
{
System
.
out
.
println
(
"\nThe Name "
+
name
+
" is a Valid Name."
);
}
else
{
System
.
out
.
println
(
"\nThe Name "
+
name
+
" is a Invalid Name."
);
}
}
}
Time-Stamp/src/com/task3/CheckLeapYearOrNot.java
0 → 100644
View file @
1aa14c51
package
com
.
task3
;
import
java.util.Scanner
;
public
class
CheckLeapYearOrNot
{
public
static
void
main
(
String
[]
args
)
{
Scanner
sc
=
new
Scanner
(
System
.
in
);
System
.
out
.
print
(
"Enter Year... "
);
int
year
=
sc
.
nextInt
();
if
((
year
%
400
==
0
)
||
(
year
%
4
==
0
&&
year
%
100
!=
0
))
{
System
.
out
.
println
(
"\n"
+
year
+
" is a Leap Year"
);
}
else
{
System
.
out
.
println
(
"\n"
+
year
+
" is Not a leap year"
);
}
System
.
out
.
println
(
"\n----- Check Leap Year Or Not ----- "
);
}
}
Time-Stamp/src/com/task4/DateFormates.java
0 → 100644
View file @
1aa14c51
package
com
.
task4
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDate
;
import
java.util.Calendar
;
import
java.util.Date
;
public
class
DateFormates
{
public
static
void
main
(
String
[]
args
)
{
Calendar
cal
=
Calendar
.
getInstance
();
System
.
out
.
println
(
"Current Date : "
+
cal
.
getTime
());
cal
.
add
(
Calendar
.
MONTH
,
1
);
System
.
out
.
println
(
"After Add One Month in Current Date : "
+
cal
.
getTime
());
System
.
out
.
println
(
" ----- First Task Done -----"
);
Calendar
cale
=
Calendar
.
getInstance
();
System
.
out
.
println
(
"\nCurrent Date : "
+
cale
.
getTime
());
cale
.
add
(
Calendar
.
DATE
,
-
15
);
System
.
out
.
println
(
"After Subsctract Fifteen Days From Current Date: "
+
(
cale
.
get
(
Calendar
.
YEAR
))
+
" "
+
(
cale
.
get
(
Calendar
.
MONTH
)
+
1
)
+
" "
+
cale
.
get
(
Calendar
.
DATE
)
+
" "
+
cale
.
get
(
Calendar
.
HOUR
)
+
":"
+
cale
.
get
(
Calendar
.
MINUTE
)
+
" "
+
(
cale
.
get
(
Calendar
.
SECOND
)));
System
.
out
.
println
(
" ----- Second Task Done -----"
);
}
}
Time-Stamp/src/task2/com/FindSecondsAndMilliSeconds.java
0 → 100644
View file @
1aa14c51
package
task2
.
com
;
public
class
FindSecondsAndMilliSeconds
{
public
static
void
main
(
String
[]
args
)
{
long
seconds
=
System
.
currentTimeMillis
()
/
1000
l
;
long
milli
=
System
.
currentTimeMillis
();
System
.
out
.
println
(
"\nSeconds since 1970: "
+
seconds
+
"\n"
);
System
.
out
.
println
(
"\nMillisecondsSeconds since 1970: "
+
milli
+
"\n"
);
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment